首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >配置Postfix relayhost

配置Postfix relayhost
EN

Stack Overflow用户
提问于 2012-03-20 17:39:10
回答 2查看 16K关注 0票数 2

我正在尝试使用/etc/ postfix /main.cf中的以下内容配置postfix以使用中继主机:

代码语言:javascript
复制
relayhost = [mailtrap.io]:2525
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = plain
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

通过telnet localhost 25发送电子邮件后,后缀日志显示:

代码语言:javascript
复制
Mar 20 10:49:52 hydra postfix/smtpd[19898]: connect from localhost[127.0.0.1]
Mar 20 10:49:52 hydra postfix/smtpd[19898]: improper command pipelining after MAIL from localhost[127.0.0.1]
Mar 20 10:49:52 hydra postfix/smtpd[19898]: 5F9BC2C30A1: client=localhost[127.0.0.1]
Mar 20 10:49:52 hydra postfix/cleanup[19902]: 5F9BC2C30A1: message-id=<20120320084952.5F9BC2C30A1@hydra>
Mar 20 10:49:52 hydra postfix/qmgr[19890]: 5F9BC2C30A1: from=<a@b.com>, size=290, nrcpt=1 (queue active)
Mar 20 10:49:52 hydra postfix/smtp[19904]: warning: SASL authentication failure: No worthy mechs found
Mar 20 10:49:52 hydra postfix/smtp[19904]: 5F9BC2C30A1: to=<c@d.com>, relay=mailtrap.io[176.9.59.220]:2525, delay=0.32, delays=0.19/0.01/0.13/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server mailtrap.io[176.9.59.220]: no mechanism available)

SMTP服务器(Relayhost)日志:

代码语言:javascript
复制
>>> EHLO hydra
250-Ok Helo 213.160.145.74, Mailtrap SMTP Server
250-AUTH PLAIN
250-NO-SOLICITING
250 SIZE 20000000
>>> QUIT
221 Ok

有什么办法解决这个问题吗?

操作系统: ubuntu。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-03-23 23:17:53

该问题是由于默认的postfix SMTP安全选项不允许有未加密的密码造成的。

Postfix doc about this issue

在这种情况下,正确的配置是:

代码语言:javascript
复制
relayhost = [mailtrap.io]:2525
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = plain
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
票数 5
EN

Stack Overflow用户

发布于 2012-12-27 01:26:34

在配置文件中,您可能需要设置smtp_use_tls = yes (请参阅http://mhawthorne.net/posts/postfix-configuring-gmail-as-relay.html中的配置)

除了以上内容之外,我还必须确保安装了libsasl2-modules

运行以下命令:

apt-get install libsasl2-modules

/etc/init.d/postfix重启

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9784327

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档