[MAIL-8818] Style and refactoring

This commit is contained in:
Michael Boelen 2016-07-31 15:43:06 +02:00
parent d05777caf2
commit 1e62769ce0
1 changed files with 9 additions and 9 deletions

View File

@ -98,10 +98,10 @@
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
@ -110,13 +110,13 @@
if [ ! "${FIND2}" = "" -a ! "${FIND3}" = "" ]; then
SHOWWARNING=1
else
Display --indent 4 --text "- Checking Postfix banner" --result "${STATUS_OK}" --color GREEN
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