Benutzerspezifische Werkzeuge
Sie sind hier: Startseite Emailsicherheit Postfix, Greylisting, Virenschutz und Spamerkennung
Artikelaktionen

Postfix, Greylisting, Virenschutz und Spamerkennung

von Michael MendeZuletzt verändert: 14.10.2009 14:58

Auch der beliebte SMTP-Server Postfix lässt sich relativ einfach dahingehend konfigurieren, dass die Emailempfänger vor Viren und Spam geschützt werden.

apt-get install postfix

ClamAV per ClamSMTP (virus-scanning SMTP proxy)

apt-get install clamsmtp

less /etc/postfix/master.cf

# virus scan filter (used by content_filter)
scan      unix  -       -       n       -       16      smtp
        -o smtp_send_xforward_command=yes
# For injecting mail back into postfix from the filter
127.0.0.1:10026 inet  n -       n       -       16      smtpd
        -o content_filter=
        -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
        -o smtpd_helo_restrictions=
        -o smtpd_client_restrictions=
        -o smtpd_sender_restrictions=
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o mynetworks_style=host
        -o smtpd_authorized_xforward_hosts=127.0.0.0/8

grep -A 2 virus /etc/postfix/main.cf
# virus scan
content_filter = scan:127.0.0.1:10025
receive_override_options = no_address_mappings
grep -v ^# /etc/clamsmtpd.conf | grep -v ^$
OutAddress: 10026
Listen: 127.0.0.1:10025
ClamAddress: /var/run/clamav/clamd.ctl
TempDirectory: /var/spool/clamsmtp
PidFile: /var/run/clamsmtp/clamsmtpd.pid
User: clamsmtp


Greylisting

apt-get install postgrey
cat - >> /etc/postfix/main.cf <<EOF
# Greylisting
smtpd_recipient_restrictions =
        permit_mynetworks
        permit_sasl_authenticated
        reject_unauth_destination
        check_policy_service inet:127.0.0.1:10023

EOF

grep -vE "^(#|$)" /etc/default/postgrey
POSTGREY_OPTS="--inet=10023 --delay=300"
POSTGREY_TEXT="Greylisted. Greylisting is used to filter spam and viruses."


Spamassassin

apt-get install spamassassin spamass-milter
grep -vE "^(#|$)" /etc/default/spamass-milter
OPTIONS="-u spamass-milter -i 127.0.0.1"
cat - >> /etc/postfix/main.cf << EOF
# Spamassassin
milter_default_action = accept
smtpd_milters = unix:/var/spool/postfix/spamass/spamass.sock
EOF
Referenz(en)