CentOS 6 + amavisd-new + clamav
(1)安裝amavisd-new 與 clamav 相關套件
1. 安裝rpmforge
http://wiki.centos.org/zh-tw/AdditionalResources/Repositories/RPMForge?action=show&redirect=zh-tw%2FRepositories%2FRPMForge
2. 應該直接走步驟3與步驟4, 但是筆者會發生某些附屬套件未安裝的錯誤 , 常見 lz 套件
2.1 安裝 lz 函式庫
yum install lzo
2.2 安裝lzop程式
yum install lzop
若無法安裝 lzop ,請 http://rpmfind.net 找 lzop 這個套件, 下載後安裝
3. 安裝防毒軟體(clamav的設定不在此討論範圍)
yum install clamav
4. amavisd-new
yum install amavisd-new
(2) 設定amavisd-new
修改/etc/amavisd.conf 找出mydomain='test.com.tw', 改成自己的網域
(3) 設定postfix
1. /etc/postfix/main.cf 要有這些設定
soft_bounce = yes
content_filter = amavisfeed:[127.0.0.1]:10024
2. /etc/postfix/master.cf 加上以下設定
amavisfeed unix - - n - 2 lmtp
-o lmtp_data_done_timeout=1200
-o lmtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
amavisfeed unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o smtpd_restriction_classes=
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
-o local_header_rewrite_clients=
3. /etc/amavisd.conf要有這兩個
$notify_method = 'smtp:[127.0.0.1]:10025';
$forward_method = 'smtp:[127.0.0.1]:10025'; # set to undef with milter!
(4) 確認amavisd-new是否預設會自動執行
ntsysv
(5) 測試
yum install telnet
telnet localhost 10024
telnet localhost 10025
(6)參考
http://fromtw.blogspot.tw/2013/06/postfix-amavisd-new-clamav.html
留言列表