Postfix + Clamav + Amavisd2019/01/24 |
|
Postfix と Clamav を連携させて 送受信メールをリアルタイムスキャンできるように設定します。
|
|
| [1] | |
| [2] | Amavisd をインストールして Clamav Server を起動します。 |
|
mail:~ #
mail:~ # zypper -n install amavisd-new spamassassin systemctl start clamd mail:~ # systemctl enable clamd |
| [3] | Amavisd を設定して起動します。 |
|
mail:~ #
vi /etc/amavisd.conf # 20行目:自ドメイン名に変更 $mydomain = ' srv.world ';
# 152行目:コメント解除して自ホスト名に変更 $myhostname = ' mail.srv.world ';
# 154,155行目:コメント解除 $notify_method = 'smtp:[127.0.0.1]:10025'; $forward_method = 'smtp:[127.0.0.1]:10025'; sa-update mail:~ # systemctl start amavis spamd mail:~ # systemctl enable amavis spamd |
| [4] | Postfix の設定です。 |
|
mail:~ #
vi /etc/postfix/main.cf # 700行目:追記 content_filter = smtp-amavis:[127.0.0.1]:10024
mail:~ #
vi /etc/postfix/master.cf # 最終行に追記
smtp-amavis unix - - n - 2 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 - - 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=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
systemctl restart postfix |
| [5] | 以上で設定完了です。 送受信メールには以下のようなヘッダが付加されます。もしウィルスが検知された場合は削除され、クライアントには配送されません。 |
|
| Sponsored Link |
|
|