mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-06-06 18:52:35 +00:00
mod/notification-email: add setting for certificate verification
This commit is contained in:
parent
3476ce35b3
commit
cb54859cad
3 changed files with 13 additions and 1 deletions
|
|
@ -37,7 +37,8 @@ Also make sure the device has correct time configured, best is to set up
|
|||
the ntp client.
|
||||
|
||||
Then edit `global-config-overlay`, add `EmailGeneralTo` with a valid
|
||||
recipient address. Finally reload the configuration.
|
||||
recipient address. Optionally add `EmailServerCertificate` if you have
|
||||
certificate verification enabled. Finally reload the configuration.
|
||||
|
||||
> ℹ️ **Info**: Copy relevant configuration from
|
||||
> [`global-config`](../../global-config.rsc) (the one without `-overlay`) to
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
:global EmailGeneralCc "";
|
||||
#:global EmailGeneralTo "mail@example.com";
|
||||
#:global EmailGeneralCc "another@example.com,third@example.com";
|
||||
:global EmailServerCertificate "";
|
||||
|
||||
# You can send Telegram notifications. Register a bot
|
||||
# and add the token and chat ids here, then install the module:
|
||||
|
|
|
|||
|
|
@ -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" ];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue