From 255b2a8244cce98a0d5253b0b11ba0860a009425 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 15 May 2020 20:34:33 +0200 Subject: global-functions: $MailServerIsUp: handle resolve errors --- global-functions | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3-54-g00ecf