本文基于postfix2.11.11和sasl2
postfix的安装详见:postfix安装
为postfix开启基于cyrus-sasl的认证功能
#验证postfix是否支持cyrus风格的sasl认证,如果输出结果如下,表示支持
[root@mail ~]# postconf -a
cyrus
dovecot
#修改/etc/postfix/main.cf
# sasl configuration
broken_sasl_auth_clients = yes
#permit_mynetworks:允许本地网络
#permit_sasl_authenticated:允许sasl验证通过的用户
#reject_invalid_hostname:拒绝不合法的主机名收发邮件
#reject_non_fqdn_hostname:拒绝主机名非FQDN格式的用户
#reject_unknown_sender_domain:拒绝未知的发件人域
#reject_non_fqdn_sender:没有FQDN用户
#reject_non_fqdn_recipient:非FQDN的接收者
#reject_unknown_recipient_domain:无法识别的收件人域
#reject_unauth_pipelining:无法验证的管道
#reject_unauth_destination:无法认证的目标地址,放最后
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
#安全选项,不直接匿名用户
smtpd_sasl_security_options = noanonymous
#The name of the configuration file (default: smtpd.conf) is configurable. It is a concatenation from a value that the Postfix SMTP server sends to the Cyrus SASL library, and the suffix .conf, added by Cyrus SASL.
#哪个应用程序使用sasl功能
smtpd_sasl_path = smtpd
#欢迎信息
smtpd_banner = Welcome to our $myhostname ESMTP,Warning:Version not Available!
[root@mail ~]# vim /usr/lib64/sasl2/smtpd.conf
pwcheck_method: saslau

本文详细介绍了如何在Postfix 2.11.11中启用Cyrus SASL认证,包括配置步骤、验证支持、设置限制及密码管理,还展示了发送邮件和测试认证过程中的常见问题与解决方法。
最低0.47元/天 解锁文章

1499

被折叠的 条评论
为什么被折叠?



