postfix 邮箱接收限制

Postfix 限制 QQ 邮箱发送到 我的 test.com 域下邮箱。

1、编辑 main.cf  添加限制:

smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access

编辑 ~/etc/postfix/main.cf 
smtpd_sender_restrictions =
        permit_mynetworks,
        reject_sender_login_mismatch,
        reject_authenticated_sender_login_mismatch,
        reject_unauthenticated_sender_login_mismatch

添加以下access示例;
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access

2、编辑  创建  /etc/postfix/sender_access 文件 (限制 策略)

限制示例 :
qq.com REJECT
# 拒绝 qq 邮箱的发送所有邮件。 mail.qq.com REJECT example.com REJECT
0.0.0.0/0 REJECT /increase your sales by / REJECT /in compliance (with|of) strict/ REJECT /lowest rates.*!/ REJECT /[:alpha:]<!--.*-->[:alpha:]/ REJECT /name ?="?.*\.(bat|scr|com|dll|exe|hta|pif|vbs)"?/ REJECT
# 其他 钓鱼邮件策略。

3、重启  postfix , postmap  加载sender_access 定义 策略:

postmap 会加载生产一个  sender_access.db 文件;

每次变更sender_access 文件都需要重新加载生成、限制策略才会生效。

postmap hash:/etc/postfix/sender_access

# /etc/init.d/postfix restart

 使用 QQ 邮箱发送给 test.com域下邮件 提示退回。

猜你喜欢

转载自www.cnblogs.com/sharesdk/p/10222181.html
今日推荐