From f9fdc2c4ee5b4b0797a08684f52a8d8dfb3ec326 Mon Sep 17 00:00:00 2001 From: William Hirigoyen Date: Thu, 15 Dec 2022 12:13:51 +0100 Subject: [PATCH] IS_LOCALHOST_IN_POSTFIX_MYDESTINATION: fix regex and add localhost.$mydomain to check --- linux/evocheck.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/evocheck.sh b/linux/evocheck.sh index 8cbab8f..3e4a7bf 100755 --- a/linux/evocheck.sh +++ b/linux/evocheck.sh @@ -131,10 +131,10 @@ check_dpkgwarning() { test -e /etc/apt/apt.conf.d/z-evolinux.conf \ || failed "IS_DPKGWARNING" "/etc/apt/apt.conf.d/z-evolinux.conf is missing" } -# Check if localhost and localhost.localdomain are set in Postfix mydestination option. +# Check if localhost, localhost.localdomain and localhost.$mydomain are set in Postfix mydestination option. check_localhost_in_postfix_mydestination() { - if ! grep mydestination /etc/postfix/main.cf | grep --quiet --extended-regexp '(localhost[^\\.]?|localhost\\.localdomain)'; then - failed "IS_LOCALHOST_IN_POSTFIX_MYDESTINATION" "'localhost' and/or 'localhost.localdomain' are missing in Postfix mydestination option. Consider adding then." + if ! grep mydestination /etc/postfix/main.cf | grep --extended-regexp 'localhost[^\\.]' | grep 'localhost.localdomain' | grep 'localhost.$mydomain'; then + failed "IS_LOCALHOST_IN_POSTFIX_MYDESTINATION" "'localhost' and/or 'localhost.localdomain' and/or 'localhost.\$mydomain' are missing in Postfix mydestination option. Consider adding then." fi } # Verifying check_mailq in Nagios NRPE config file. (Option "-M postfix" need to be set if the MTA is Postfix)