上海青羽电脑科技有限公司

技术园地

TECHNOLOGY

技术园地

Postfix自带反垃圾设置

发布时间:2015-10-10  /  浏览次数:10,973次

此处的反垃圾邮件只是在MTA级的一些预防垃圾邮件的设置,可根据实际情况以及自己的需要进行调整。

# vi /usr/local/etc/postfix/main.cf

增加以下内容:

smtpd_helo_required = yes
smtpd_delay_reject = yes
disable_vrfy_command = yes

smtpd_client_restrictions =
check_client_access hash:/usr/local/etc/postfix/client_access

smtpd_helo_restrictions=
reject_invalid_hostname,check_helo_access hash:/usr/local/etc/postfix/helo_access

# SMTP sender login matching config
smtpd_sender_restrictions =
reject_non_fqdn_sender,
reject_unknown_sender_domain,
check_sender_access hash:/usr/local/etc/postfix/sender_access

#smtpd related config
smtpd_recipient_restrictions=
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname,
reject_rbl_client cbl.anti-spam.org.cn

smtpd_data_restrictions = reject_unauth_pipelining
header_checks = regexp:/usr/local/etc/postfix/head_checks
body_checks = regexp:/usr/local/etc/postfix/body_checks

生成虚拟域数据库

# touch /usr/local/etc/postfix/head_checks
# touch /usr/local/etc/postfix/body_checks
# touch /usr/local/etc/postfix/client_access
# touch /usr/local/etc/postfix/sender_access
# touch /usr/local/etc/postfix/helo_access
# postmap /usr/local/etc/postfix/head_checks
# postmap /usr/local/etc/postfix/body_checks
# postmap /usr/local/etc/postfix/client_access
# postmap /usr/local/etc/postfix/sender_access
# postmap /usr/local/etc/postfix/helo_access

 

一站式解决邮件收发与安全难题
靠谱工程师为您提供一对一的专业技术支持与服务
申请试用
400-602-8603