Debian 8 Jessie
Sponsored Link

Postfix + Clamav + ClamSMTP2015/05/15

 
Configure Virus-Scanning with Postfix + Clamav + ClamSMTP.
[1]
[2] Install Clamd and Clamsmtp.
root@mail:~#
aptitude -y install clamav-daemon clamsmtp
root@mail:~#
vi /etc/clamsmtpd.conf
# line 27: uncomment

Header: X-AV-Checked: ClamAV using ClamSMTP
# line 45: change

User:
clamav
root@mail:~#
chown -R clamav. /var/spool/clamsmtp

root@mail:~#
chown -R clamav. /var/run/clamsmtp

root@mail:~#
vi /etc/postfix/main.cf
# add to the end

content_filter = scan:127.0.0.1:10026
root@mail:~#
vi /etc/postfix/master.cf
# add to the end

scan unix -       -       n       -       16       smtp
   -o smtp_data_done_timeout=1200
   -o smtp_send_xforward_command=yes
   -o disable_dns_lookups=yes
127.0.0.1:10025 inet n       -       n       -       16       smtpd
   -o content_filter=
   -o local_recipient_maps=
   -o relay_recipient_maps=
   -o smtpd_restriction_classes=
   -o smtpd_client_restrictions=
   -o smtpd_helo_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

root@mail:~#
systemctl restart clamav-daemon

root@mail:~#
systemctl restart clamsmtp

root@mail:~#
systemctl restart postfix

  These lines below are added in header section of emails after this configuration.
Matched Content