如何在 Postfix 中设置 smtpd 的用户名和密码?

Ove*_*erv 4 smtp postfix authentication

我通过将此配置添加到main.cf以下内容将 Postfix 设置为 SMTP 服务器:

myhostname = foo.com
mydomain = foo.com
myorigin = $mydomain

smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_helo_required = yes
smtpd_helo_restrictions = reject_invalid_helo_hostname
smtpd_recipient_restrictions = reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
Run Code Online (Sandbox Code Playgroud)

sasl_passwd文件如下所示:

foo.com    user:pass
Run Code Online (Sandbox Code Playgroud)

我已经sasl_passwd.db从那个文件中生成了一个。不幸的是,当使用用户名和密码连接到我的服务器时,我不断遇到身份验证失败。我究竟做错了什么?

seb*_*bix 5

你是混淆smtpd_saslsmtp_sasl,第一是用户认证服务器上提交电子邮件交付,当后缀不直接而且还能提供通过中继,而后者被用来postfix的自己的身份

不幸的是,当使用用户名和密码连接到我的服务器时,我不断遇到身份验证失败。

您说,正在连接到服务器,所以我猜您想将 SASL 用于 smtp d。用于用户身份验证的 postfix 中的 SASL 通常通过使用 dovecot 或 cyrus 来完成。

关于从哪里开始面对您实际接近的任务的两个提示: