mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: $FlushEmailQueue: do not flush with resolver issues
Flushing the mail queue with resolver issues can flood the log with messages like: e-mail;error Error sending e-mail <=?utf-8?Q?[MikroTik] =F0=9F=92=BE=E2=98=81 Cloud backup?=>: DNS resolve failed Try to avoid this...
This commit is contained in:
@ -323,6 +323,7 @@
|
||||
:global EmailQueue;
|
||||
|
||||
:global EitherOr;
|
||||
:global IsDNSResolving;
|
||||
:global IsTimeSync;
|
||||
:global LogPrintExit2;
|
||||
|
||||
@ -334,6 +335,11 @@
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :typeof [ :toip [ /tool/e-mail/get address ] ] ] != "ip" && [ $IsDNSResolving ] = false) do={
|
||||
$LogPrintExit2 debug $0 ("Server address is a DNS name and resolving fails, not flushing.") false;
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /system/scheduler/find where name="FlushEmailQueue" ] ] > 0 && $QueueLen = 0) do={
|
||||
$LogPrintExit2 warning $0 ("Flushing E-Mail messages from scheduler, but queue is empty.") false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user