close
嗯, 最近在整理 MX server, 上頭跑的是 postfix + postgrey + amavisd-new + vscan + p5-Mail-SpamAssassin

postgrey的部分請看這篇.
其餘的安裝步驟如下:

cd /usr/ports/mail/p5-Mail-SpamAssassin && make install clean
(勾選AS_ROOT, GNUPG, RAZOR)

cd /usr/ports/security/amavisd-new/ && make install clean

cd /usr/ports/security/vscan && make install clean

cd /usr/local/etc && cp amavisd.conf-sample amavisd.conf && chmod u+w amavisd.conf
vim amavisd.conf
修改$mydomain, $final_banned_destiny, $final_spam_destiny, $sa_tag2_level_deflt

vim /etc/rc.conf
#amavisd
amavisd_enable="YES"
amavisd_ram="512m"

vim /usr/local/etc/postfix/main.cf
#amvisd-new
content_filter = smtp-amavis:[127.0.0.1]:10024

vim /usr/local/etc/postfix/master.cf
smtp-amavis unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-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

sh /usr/local/etc/rc.d/amavisd start
sh /usr/local/etc/rc.d/postfix restart

crontab加上每天跑一次 /usr/local/bin/sa-update & /usr/local/sbin/update_dat

PS: /usr/local/etc/mail/spamassassin/local.cf 可設定spamassassin想要的rule

arrow
arrow
    全站熱搜

    Izero 發表在 痞客邦 留言(0) 人氣()