mod/notification-email: add setting for certificate verification

This commit is contained in:
Christian Hesse 2026-04-22 11:04:57 +02:00
parent f5dbc27a01
commit 1f460b5bae
5 changed files with 17 additions and 2 deletions

View file

@ -37,7 +37,9 @@
# flush e-mail queue
:set FlushEmailQueue do={ :onerror Err {
:global EmailQueue;
:global EmailServerCertificate;
:global CertificateAvailable;
:global EitherOr;
:global EMailGenerateFrom;
:global FileExists;
@ -90,6 +92,14 @@
:return false;
}
:if (([ /tool/e-mail/get ]->"certificate-verification") ~ "^yes" && \
[ :len $EmailServerCertificate ] > 0) do={
:if ([ $CertificateAvailable $EmailServerCertificate "email" ] = false) do={
$LogPrint warning $0 ("Downloading required certificate failed.");
:return false;
}
}
/system/scheduler/set interval=($QueueLen . "m") comment="Sending..." \
[ find where name="_FlushEmailQueue" ];