/usr/share/yasat/plugins/postfix.test is in yasat 755-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | #!/bin/sh
################################################################################
# #
# Copyright (C) 2008-2014 LABBE Corentin <clabbe.montjoie@gmail.com>
#
# YASAT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# YASAT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with YASAT. If not, see <http://www.gnu.org/licenses/>.
# #
################################################################################
POSSIBLE_POSTFIX_CONF="/etc/postfix/main.cf /usr/local/etc/postfix/main.cf"
POSTFIX_CONF="/etc/postfix/main.cf"
for LOCATION in ${POSSIBLE_POSTFIX_CONF}
do
if [ -e "${LOCATION}" ]
then
POSTFIX_CONF="${LOCATION}"
fi
done
Title "Check postfix"
if [ ! -e "$POSTFIX_CONF" ]
then
return 1;
fi
FindValueOfEqual $POSTFIX_CONF smtp_tls_cert_file JUSTTEST
if [ ! -z "$RESULTAT" ]
then
Display --indent 2 --text "TLS $RESULTAT" --result OK --color GREEN
check_file $RESULTAT 4 CERT
else
Display --indent 2 --text "No TLS" --result ADVICE --color ORANGE --advice POSTFIX_NO_TLS
fi
FindValueOfEqual $POSTFIX_CONF smtp_tls_key_file JUSTTEST
if [ ! -z "$RESULTAT" ]
then
Display --indent 2 --text "TLS $RESULTAT" --result OK --color GREEN
check_file $RESULTAT 4 PRIVKEY
else
Display --indent 2 --text "No TLS" --result ADVICE --color ORANGE --advice POSTFIX_NO_TLS
fi
FindValueOfEqual $POSTFIX_CONF smtpd_tls_cert_file JUSTTEST
if [ ! -z "$RESULTAT" ]
then
Display --indent 2 --text "TLS $RESULTAT" --result OK --color GREEN
check_file $RESULTAT 4 CERT
else
Display --indent 2 --text "No TLS" --result ADVICE --color ORANGE --advice POSTFIX_NO_TLS
fi
FindValueOfEqual $POSTFIX_CONF smtpd_tls_key_file JUSTTEST
if [ ! -z "$RESULTAT" ]
then
Display --indent 2 --text "TLS $RESULTAT" --result OK --color GREEN
check_file $RESULTAT 4 PRIVKEY
else
Display --indent 2 --text "No TLS" --result ADVICE --color ORANGE --advice POSTFIX_NO_TLS
fi
FindValueOfEqual $POSTFIX_CONF smtpd_use_tls JUSTTEST
if [ ! -z "$RESULTAT" ]
then
Display --indent 2 --text "smtpd_use_tls is obsolete, use smtpd_tls_security_level instead" --result OBSOLETE --color ORANGE --advice POSTFIX_OBSOLETE_TLS
else
Display --indent 2 --text "No smtpd_use_tls" --result NOTFOUND --color GREEN
fi
FindValueOfEqual $POSTFIX_CONF smtp_use_tls JUSTTEST
if [ ! -z "$RESULTAT" ]
then
Display --indent 2 --text "smtp_use_tls is obsolete, use smtp_tls_security_level instead" --result OBSOLETE --color ORANGE --advice POSTFIX_OBSOLETE_TLS
else
Display --indent 2 --text "No smtp_use_tls" --result NOTFOUND --color GREEN
fi
# http://www.postfix.org/TLS_README.html
#TODO relay domains
#TODO obsolete smtpd_use_tls
#TODO check rights of file (like virtual_uid_maps)
#TODO check ending of smtpd_sender_restriction (must be reject_unauth_destination)
return 0;
|