Postfix
1 前言
一个问题,一篇文章,一出故事。
本章将整理如何限制PostFix特定用户只能发送特定的域。
2 最佳实践
2.1 实践环境
邮件服务端,如有需要请参考,
2.2 配置过程
2.2.1 增加或修改配置
vim /etc/postfix/main.cf
增加或者修改如下配置,
smtpd_restriction_classes = internal internal = check_recipient_access hash:/etc/postfix/internal_domains, reject #smtpd_client_restrictions = check_client_access hash:/etc/postfix/access, reject smtpd_recipient_restrictions = check_client_access hash:/etc/postfix/access, reject
2.2.2 定义客户端限制列表
vim /etc/postfix/access
准备如下测试配置,
10.168.0.8 internal #Will Test 10.168.0.30 OK #Free Test
2.2.3 定义可发送邮件域列表
vim /etc/postfix/internal_domains
准备如下测试配置,
cmdschool.org OK cmdschool.net OK cmdschool.com OK cmdschool.cn OK
2.2.4 执行如下命令检查配置并使配置生效
postmap /etc/postfix/access postmap /etc/postfix/internal_domains postfix check systemctl reload postfix
没有评论