mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-06-21 01:25:52 +02:00
mod/notification-email: add error handling when sending mail
This commit is contained in:
parent
bd3cc3bbd4
commit
ff218e4ce5
1 changed files with 31 additions and 26 deletions
|
@ -89,8 +89,9 @@
|
|||
|
||||
:foreach Id,Message in=$EmailQueue do={
|
||||
:if ([ :typeof $Message ] = "array" ) do={
|
||||
:local Attach ({});
|
||||
:while ([ /tool/e-mail/get last-status ] = "in-progress") do={ :delay 1s; }
|
||||
:onerror Err {
|
||||
:local Attach ({});
|
||||
:foreach File in=[ :toarray [ $EitherOr ($Message->"attach") "" ] ] do={
|
||||
:if ([ :len [ /file/find where name=$File ] ] = 1) do={
|
||||
:set Attach ($Attach, $File);
|
||||
|
@ -118,6 +119,10 @@
|
|||
:set Wait false;
|
||||
}
|
||||
} while=($Wait = true);
|
||||
} do={
|
||||
$LogPrint warning $0 ("Sending queued mail failed: " . $Err);
|
||||
:set AllDone false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue