postfix中继访问在465上被SSL拒绝

我为我的服务器设置Postfix和Dovecot,使用自签名证书,一切正常。 我可以发送电子邮件,但是我不能发送电子邮件从我的服务器说,我的iPhone。 我得到中继访问被拒绝。

这是我设置SSL的原因之一,因为我知道这不会是一个问题。 我现在想知道,如果匿名TLS连接是因为我使用自签名证书,或者因为我没有正确login,我应该。 我的邮件客户端(mac)设置为使用端口465,并检查SSL。

我从master.conf submission参数:

 submission inet n - n - - smtpd -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_sasl_type=dovecot -o smtpd_sasl_path=private/auth -o smtpd_sasl_security_options=noanonymous -o smtpd_sasl_local_domain=$myhostname -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o smtpd_sender_login_maps=hash:/etc/postfix/virtual -o smtpd_sender_restrictions=reject_sender_login_mismatch -o smtpd_recipient_restrictions=reject_non_fqdn_recipient, reject_unknown_recipient_domain,permit_sasl_authenticated,reject # -o milter_macro_daemon_name=ORIGINATING 

日志:

 Jul 12 22:07:24 www postfix/smtpd[29973]: 0020 7a 1a 73 15 eb dc ce 99| zs.... Jul 12 22:07:24 www postfix/smtpd[29973]: SSL_accept:SSLv3 read finished A Jul 12 22:07:24 www postfix/smtpd[29973]: cpc98338-croy25-2-0-cust350.19-2.cable.virginm.net[xxxx]: Reusing old session Jul 12 22:07:24 www postfix/smtpd[29973]: Anonymous TLS connection established from cpc98338-croy25-2-0-cust350.19-2.cable.virginm.net[xxxx]: TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits) Jul 12 22:07:24 www postfix/smtpd[29973]: NOQUEUE: reject: RCPT from cpc98338-croy25-2-0-cust350.19-2.cable.virginm.net[xxxx]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to= <[email protected]> proto=ESMTP helo=<[192.168.0.14]> Jul 12 22:07:24 www postfix/smtpd[29973]: disconnect from cpc98338-croy25-2-0-cust350.19-2.cable.virginm.net[xxxx] 

我将如何去解决这个问题?

  • 还有一些错误,即使在端口25上只有明文(无ssl / tls)的情况下,你也可以从iPhone(也可能是iMac电子邮件客户端)发送邮件( 这个端口可能会被你的ISP阻止 )和端口587 。 当然不build议不使用SSL / TLS,但是可以并且符合定义的标准。 检查/var/log/mail.log (在Debian系列上)或其他Postfix /系统邮件日志文件,看看当你不能提交邮件到25或587时会发生什么。当然,确认一切正常之前,通过与SMTP聊天您的服务器通过telnet: telnet yourserver.tld 25telnet yourserver.tld 587 。 这里和这里是一个指南。

  • 使用master.cf的指令来启用提交:

     submission inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,permit_mynetworks,check_relay_domains,reject 

    请注意,这个-o完全依赖于你在服务器上拥有的东西,但是提供了一些常见的默认值。

  • SMTPS(465)启用取消注释此行:

     smtps inet n – – – – smtpd 

    并遵循-o的。 再一次,你必须根据你的需要来调整它,但是理智的默认值通常在master.cf

  • 当然任何改变后重新启动Postfix(不需要说这个,但不能伤害)

希望这可以帮助。

您的手机没有对发送邮件进行身份validation。 可能是因为你忘了告诉它它需要。

改变这一点,它应该工作。 或者你至less会有一个不同的问题。

对于别人的价值,下面的固定我的中继问题。 希望它可以帮助你。

我通过以下方式解决了问题

– 转向港口587

在master.cf中更改smtp和提交:

 -o smtpd_sender_restrictions=reject_sender_login_mismatch 

至 :

  -o smtpd_sender_restrictions=permit_sasl_authenticated,reject_sender_login_mismatch 

现在,我可以将用户销售的邮件发送到任何一个login到服务器的用户。

匿名连接build立消息:

 Jul 30 10:36:47 www postfix/smtpd[9618]: SSL_accept:SSLv3 flush data Jul 30 10:36:47 www postfix/smtpd[9618]: Anonymous TLS connection established from cpc98338-croy25-2-0-cust350.19-2.cable.virginm.net[82.45.65.95]: TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits) 

我认为是使用自签名证书的结果。

我仍然有兴趣找出为什么我与我的客户login如此:

 Jul 30 10:35:59 www dovecot: imap-login: Login: user=<sales>, method=PLAIN, rip=82.45.65.95, lip=172.31.8.87, mpid=9585, TLS, session=<6+DgeoZV4ABSLUFf> Jul 30 10:35:59 www dovecot: imap-login: Login: user=<sales>, method=PLAIN, rip=82.45.65.95, lip=172.31.8.87, mpid=9608, TLS, session=<Ze/neoZV4gBSLUFf> Jul 30 10:36:46 www postfix/smtpd[9618]: initializing the server-side TLS engine Jul 30 10:36:46 www postfix/smtpd[9618]: connect from cpc98338-blu-25-2-0-cust350.19-2.cable.virginm.net[82.xxx] Jul 30 10:36:46 www postfix/smtpd[9618]: setting up TLS connection from cpc98338-blu-25-2-0-cust350.19-2.cable.virginm.net[82.xxx] Jul 30 10:36:46 www postfix/smtpd[9618]: cpc98338-blu-25-2-0-cust350.19-2.cable.virginm.net[82.xxx]: TLS cipher list "ALL:!EXPORT:!LOW:+RC4:@STRENGTH" Jul 30 10:36:46 www postfix/smtpd[9618]: SSL_accept:before/accept initializati 

而其他人(可能是垃圾邮件发送者)我看到这样的消息:

  Jul 30 10:54:09 www postfix/smtpd[9686]: warning: unknown[80.82.78.85]: SASL LOGIN authentication failed: UGFzc3dvcmQ6 Jul 30 10:54:09 www postfix/smtpd[9686]: disconnect from unknown[80.82.78.85] 

嗯,可能是因为他们login在端口25(smtpd)。