Debian 7.0
Sponsored Link

Clamavとの連携 - ClamSMTP2013/05/11

 
clamav はインストール済みとして、 Postfix と Clamav を連携させてメールをリアルタイムスキャンできるようにします。
[1] Clamd と Clamsmtp のインストールと設定
root@mail:~#
aptitude -y install clamav-daemon clamsmtp
root@mail:~#
vi /etc/clamsmtpd.conf
# 11行目:変更

OutAddress:
10026
# 21行目:変更

Listen:
127.0.0.1:10025
# 27行目:コメント解除

Header: X-AV-Checked: ClamAV using ClamSMTP
root@mail:~#
vi /etc/postfix/main.cf
# 最終行へ追記

content_filter = scan:127.0.0.1:10025
root@mail:~#
vi /etc/postfix/master.cf
# 最終行へ以下全行追記

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:10026 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:~#
/etc/init.d/clamav-daemon start

 * Starting ClamAV daemon clamd
   ...done.
root@mail:~#
/etc/init.d/clamsmtp restart

Restarting virus filtering SMTP proxy: clamsmtpd.
root@mail:~#
/etc/init.d/postfix restart

Stopping Postfix Mail Transport Agent: postfix.
Starting Postfix Mail Transport Agent: postfix.
  メールには以下のようなヘッダが付加されるようになります。
関連コンテンツ