试图发送邮件时出现TLS错误

我在我的服务器上安装了exim,我想用php的mail()函数发送一个用apache托pipe的网站的mail()
当我尝试发送电子邮件时,我没有任何错误,但电子邮件永远不会到达。 我已经检查了exim的日志,我有这个:

 2015-12-28 15:51:36 1aDZ96-00052a-5y <= [email protected] U=www-data P=local S=490 2015-12-28 15:51:37 1aDZ96-00052a-5y TLS error on connection to mx2.hotmail.com [65.54.188.72] (recv): The TLS connection was non-properly terminated. 2015-12-28 15:51:37 1aDZ96-00052a-5y TLS error on connection to mx2.hotmail.com [65.54.188.72] (send): The specified session has been invalidated for some reason. 2015-12-28 15:51:37 1aDZ96-00052a-5y ** [email protected] R=dnslookup T=remote_smtp X=TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256 DN="CN=*.hotmail.com": SMTP error from remote mail server after MAIL FROM:<[email protected]> SIZE=1526: host mx2.hotmail.com [65.54.188.72]: 550 SC-002 (BAY004-MC1F20) Unfortunately, messages from xxx.xxx.xxx.xxx weren't sent. Please contact your Internet service provider since part of their network is on our block list. You can also refer your provider to http://mail.live.com/mail/troubleshooting.aspx#errors. 2015-12-28 15:51:38 1aDZ97-00052f-Uc <= <> R=1aDZ96-00052a-5y U=Debian-exim P=local S=1747 2015-12-28 15:51:38 1aDZ96-00052a-5y Completed 

每个尝试发送电子邮件产生这样的错误。 我搜查了什么可能导致这一点。 我发现当服务器被列入黑名单时可能会出现类似的错误,但是我的服务器没有任何理由(我用mxtoolbox检查过,没有问题)。

这里发布的错误显示了一个hotmail接收者地址,但是我得到了像其他目标域错误的可能性:

 SMTP error from remote mail server after MAIL FROM:<[email protected]> SIZE=1898: host smtp-in.orange.fr [193.252.22.65]: 501 5.1.0 Emetteur invalide. Invalid Sender. O 

我也被告知,始终使用sendmail提供一个发件人地址的非-f选项,但是它只会更改错误日志中显示的发件人地址,并且错误是相同的。

我该怎么办 ?

以下是您遇到的错误的解释:

  1. 2015-12-28 15:51:37 1aDZ96-00052a-5y TLS error on connection to mx2.hotmail.com [65.54.188.72] (send): The specified session has been invalidated for some reason.

这意味着您正尝试为您的服务器使用自签名的SSL证书,因为互联网上的大多数服务器都拒绝连接,所以不应该在testing环境以外的任何地方使用它们。

要使用SSL,您需要获得一个正确签名的证书(例如,您可以从StartSSL或WoSign免费获得)。

  1. 2015-12-28 15:51:37 1aDZ96-00052a-5y ** [email protected] R=dnslookup T=remote_smtp X=TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256 DN="CN=*.hotmail.com": SMTP error from remote mail server after MAIL FROM:<[email protected]> SIZE=1526: host mx2.hotmail.com [65.54.188.72]: 550 SC-002 (BAY004-MC1F20) Unfortunately, messages from xxx.xxx.xxx.xxx weren't sent. Please contact your Internet service provider since part of their network is on our block list. You can also refer your provider to http://mail.live.com/mail/troubleshooting.aspx#errors

这意味着你正在尝试在家庭ISP上运行邮件服务器或者以其他方式损害networking。 大多数主要邮件服务器将不接受来自家庭IP的邮件。 如果您希望邮件传递,您必须遵守规则 – 要求您的ISP转到http://mail.live.com/mail/troubleshooting.aspx#errors并执行Microsoft提出的问题,这可能是解决问题的唯一方法它。 但是,首先你应该联系live.com支持,并询问他们需要什么来清单你的主机。

准备与每一个主要的邮件服务联系,并与之长时间的通信,让您的邮件stream动。

  1. SMTP error from remote mail server after MAIL FROM:<[email protected]> SIZE=1898: host smtp-in.orange.fr [193.252.22.65]: 501 5.1.0 Emetteur invalide. Invalid Sender.

这意味着您发送邮件的域名与orange.fr期望的不一致。 检查是否有MXlogging正确parsing到您发送电子邮件的IP地址

您本地的TLS证书可能小于1024位。 重新键入并确保使用1024或2048的密钥大小。确保Exim正在使用正确的新密钥,并且您应该很好。