因此我按照本指南设置了具有多个域/IP 的 Postfixhttps://unix.stackexchange.com/a/179175/102085
但是现在我尝试发送电子邮件时出现以下错误
Login failed, please check the username and password and try again.
日志档案:
Jul 2 10:30:59 admin postfix/smtpd[2697]: connect from unknown[176.31.26.12]
Jul 2 10:30:59 admin postfix/smtpd[2697]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
Jul 2 10:30:59 admin postfix/smtpd[2697]: warning: unknown[176.31.26.12]: SASL LOGIN authentication failed: generic failure
Jul 2 10:30:59 admin postfix/smtpd[2697]: lost connection after AUTH from unknown[176.31.26.12]
Jul 2 10:30:59 admin postfix/smtpd[2697]: disconnect from unknown[176.31.26.12]
Jul 2 10:31:03 admin sendmail[2705]: t62DV1g7002705: from=root, size=531, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Jul 2 10:31:03 admin sendmail[2705]: t62DV1g7002705: to=root, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=30531, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
/etc/postfix/master.cf
#smtp inet n - n - - smtpd
89.46.10.25:smtp inet n - - - - smtpd -o myhostname=host1.domain1.com
89.46.10.26:smtp inet n - - - - smtpd -o myhostname=host1.domain2.com
我遗漏了什么?我已创建用户“admin”,密码正确。当我切换master.cf
到smtp inet n - n - - smtpd
并注释这两个 IP 时,它就可以正常工作。
答案1
那无法连接到 saslauthd 服务器:没有此文件或目录错误消息表明 postfix 无法连接到 saslauthd。如果 saslauthd 正在运行(如您所说),则意味着 postfix 和 saslauthd 没有使用相同的位置作为它们用于通信的 Unix 域套接字。
- 在 中
/etc/postfix/main.cf
,检查参数 的值smtpd_sasl_path
。请记住,此路径相对于后缀 chroot(默认情况下为/var/spool/postfix
)。它应该类似于var/run/saslauthd
,即前面示例中套接字的完整路径为/var/spool/postfix/var/run/saslauthd
。 - 在
/etc/sysconfig/saslauthd
套接字路径是否与 Postfix 期望的完整路径匹配。您应该看到类似以下内容,指向套接字位置:SOCKETDIR = / var / spool / postfix / var / run / saslauthd
如果您执行上述两项操作并检查您的配置一致,那么您的身份验证就应该有效。
检查postfix 文档有关 SASL 配置的更多信息。