Postfixlogin失败,请检查用户名和密码

所以我按照这个指南设置了多个域/ IP的Postfix https://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 

我错过了什么? 我创build了用户“admin”,密码正确。 当我将master.cf切换到smtp inet n - n - - smtpd并注释它工作的两个IP。

不能连接到saslauthd服务器:没有这样的文件或目录错误消息表明,后缀无法连接到saslauthd。 如果saslauthd正在运行,就像你说的那样,这意味着postfix和saslauthd不使用它们用于通信的Unix域套接字的相同位置。

  1. /etc/postfix/main.cf ,检查参数smtpd_sasl_path的值。 请记住,这个path是相对于后缀chroot(默认是/var/spool/postfix )。 它应该是类似于var/run/saslauthd ,也就是前面例子中socket的完整path是/var/spool/postfix/var/run/saslauthd
  2. /etc/sysconfig/saslauthd检查套接字path是否匹配postfix预期的完整path。 你应该看到如下的东西,指向套接字位置:
     SOCKETDIR =的/ var /线轴/后缀的/ var /运行/ saslauthd
    

如果您同时执行上述两项操作,并检查您的configuration是否一致,那么您的身份validation应该可行。

检查后缀文档以获取有关SASLconfiguration的更多信息。