diff options
author | Christian Hesse <mail@eworm.de> | 2020-05-15 20:34:33 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-05-15 20:34:33 +0200 |
commit | 255b2a8244cce98a0d5253b0b11ba0860a009425 (patch) | |
tree | 145931c2e5f8899b41dd276be5436cbbf85abf15 | |
parent | 215bf78ce1dca7596629bd88793d0859c96ed24e (diff) |
global-functions: $MailServerIsUp: handle resolve errors
-rw-r--r-- | global-functions | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/global-functions b/global-functions index 83d7b2a..bae9fd6 100644 --- a/global-functions +++ b/global-functions @@ -338,7 +338,12 @@ $LogPrintExit warning ("Adding netwatch entry for mail server.") false; :local MailHost $MailServer; :if ([ :typeof [ :toip $MailHost ] ] != "ip" ) do={ - :set MailHost [ :resolve $MailServer ]; + :do { + :set MailHost [ :resolve $MailServer ]; + } on-error={ + $LogPrintExit warning ("Resolving mail server failed.") false; + :return false; + } } / tool netwatch add comment=$MailServer host=$MailHost; } |