From 1e62769ce08631cb2fe904d3e6e7c0b4f75205d6 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sun, 31 Jul 2016 15:43:06 +0200 Subject: [MAIL-8818] Style and refactoring --- include/tests_mail_messaging | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/tests_mail_messaging b/include/tests_mail_messaging index 999f5251..1363be9c 100644 --- a/include/tests_mail_messaging +++ b/include/tests_mail_messaging @@ -98,25 +98,25 @@ Register --test-no MAIL-8818 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Check Postfix configuration: banner" if [ ${SKIPTEST} -eq 0 ]; then LogText "Test: Checking Postfix banner" - FIND1=`${POSTCONFBINARY} 2> /dev/null | grep '^smtpd_banner' | grep 'postfix'` - FIND2=`${POSTCONFBINARY} 2> /dev/null | grep '^smtpd_banner' | grep '$mail_name'` - FIND3=`${POSTCONFBINARY} 2> /dev/null | grep '^mail_name' | grep -i 'postfix'` - #YYY Check if OS name shows up in banner + FIND1=$(${POSTCONFBINARY} 2> /dev/null | grep '^smtpd_banner' | grep 'postfix') + FIND2=$(${POSTCONFBINARY} 2> /dev/null | grep '^smtpd_banner' | grep '$mail_name') + FIND3=$(${POSTCONFBINARY} 2> /dev/null | grep '^mail_name' | grep -i 'postfix') + #TODO Check if OS name shows up in banner #FIND4=`${POSTCONFBINARY} 2> /dev/null | grep '^smtpd_banner' | egrep "${OS}|${LINUX_VERSION}` SHOWWARNING=0 if [ ! "${FIND1}" = "" ]; then SHOWWARNING=1 - else + else if [ ! "${FIND2}" = "" -a ! "${FIND3}" = "" ]; then SHOWWARNING=1 - else - Display --indent 4 --text "- Checking Postfix banner" --result "${STATUS_OK}" --color GREEN + else + Display --indent 4 --text "- Postfix banner" --result "${STATUS_OK}" --color GREEN fi fi if [ ${SHOWWARNING} -eq 1 ]; then - Display --indent 4 --text "- Checking Postfix banner" --result "${STATUS_WARNING}" --color RED + Display --indent 4 --text "- Postfix banner" --result "${STATUS_WARNING}" --color RED LogText "Result: found mail_name in SMTP banner, and/or mail_name contains 'Postfix'." - ReportWarning ${TEST_NO} "L" "Found mail_name in SMTP banner, and/or mail_name contains 'Postfix'" + ReportWarning ${TEST_NO} "Found mail_name in SMTP banner, and/or mail_name contains 'Postfix'" ReportSuggestion ${TEST_NO} "You are advised to hide the mail_name (option: smtpd_banner) from your postfix configuration. Use postconf -e or change your main.cf file (${POSTFIX_CONFIGFILE})" fi fi -- cgit v1.2.3