diff options
author | Christian Hesse <mail@eworm.de> | 2022-09-15 21:49:06 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-09-15 22:03:19 +0200 |
commit | f2457513399799a5183f00738081a606efd39afc (patch) | |
tree | 737d90182030388a86e8d46ef24a007200f564fb /global-functions | |
parent | 220dd8f892ee3f0864ea13838642bc40a574dcb5 (diff) |
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...
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/global-functions b/global-functions index df286b5..8d8ac1c 100644 --- a/global-functions +++ b/global-functions @@ -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; } |