发送到某些地址时出现Smtp问题-错误:服务器未接受rcpt

时间:2019-05-15 10:38:02

标签: smtp phpmailer

网站迁移到其他服务器之后,我们在通过SMTP(某些自定义的PHPMailer)使用PHP发送电子邮件时遇到了问题。 我们可以将电子邮件发送到大多数地址,但也有一些误码,如下所示。 anaybody有什么建议怎么了?是SMTP服务器问题还是脚本问题? SMTP不应该返回一些特定的错误吗?

SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "220 mx.sitte.com.pl ESMTP Exim 4.90_1 Wed, 15 May 2019 12:16:46 +0200 "
SMTP -> get_lines(): $data is "220 mx.sitte.com.pl ESMTP Exim 4.90_1 Wed, 15 May 2019 12:16:46 +0200 "
SMTP -> FROM SERVER:220 mx.sitte.com.pl ESMTP Exim 4.90_1 Wed, 15 May 2019 12:16:46 +0200
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] "
SMTP -> get_lines(): $data is "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] "
SMTP -> get_lines(): $data was "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] "
SMTP -> get_lines(): $str is "250-SIZE 52428800 "
SMTP -> get_lines(): $data is "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] 250-SIZE 52428800 "
SMTP -> get_lines(): $data was "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] 250-SIZE 52428800 "
SMTP -> get_lines(): $str is "250-8BITMIME "
SMTP -> get_lines(): $data is "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] 250-SIZE 52428800 250-8BITMIME "
SMTP -> get_lines(): $data was "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] 250-SIZE 52428800 250-8BITMIME "
SMTP -> get_lines(): $str is "250-PIPELINING "
SMTP -> get_lines(): $data is "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING "
SMTP -> get_lines(): $data was "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING "
SMTP -> get_lines(): $str is "250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $data is "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $data was "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $str is "250 HELP "
SMTP -> get_lines(): $data is "250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250 HELP "
SMTP -> FROM SERVER: 250-mx.sitte.com.pl Hello mx.sitte.com.pl [5.187.55.123] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250 HELP
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6 "
SMTP -> get_lines(): $data is "334 VXNlcm5hbWU6 "
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6 "
SMTP -> get_lines(): $data is "334 UGFzc3dvcmQ6 "
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "235 Authentication succeeded "
SMTP -> get_lines(): $data is "235 Authentication succeeded "
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250 OK "
SMTP -> get_lines(): $data is "250 OK "
SMTP -> FROM SERVER:250 OK
SMTP -> FROM SERVER:
SMTP -> ERROR: RCPT not accepted from server:
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250 Accepted "
SMTP -> get_lines(): $data is "250 Accepted "
SMTP -> FROM SERVER:250 Accepted 

Exim log-s

成功发送至test@sitte.pl的电子邮件

2019-05-15 12:57:56 1hQrbg-0000gV-9k <= felcia@felcia.co.uk H=mx.sitte.com.pl (randki.felcia.co.uk) [5.187.55.123] P=esmtpsa X=TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128 CV=no A=login:felcia S=3991 id=b8c63f820e5911f1c7572e25e6bcc7ec@randki.felcia.co.uk T="Odpowiedź na Twoje ogłoszenie: test test test test test test" from <felcia@felcia.co.uk> for test@sitte.pl felcia@felcia.co.uk
2019-05-15 12:57:56 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1hQrbg-0000gV-9k
2019-05-15 12:57:56 1hQrbg-0000gV-9k => felcia <felcia@felcia.co.uk> F=<felcia@felcia.co.uk> SRS=<SRS0=2d1Fi9=TP=felcia.co.uk=felcia@felcia.co.uk> R=localuser T=local_delivery S=4134
2019-05-15 12:57:56 1hQrbg-0000gV-9k [91.244.71.100] SSL verify error: depth=0 error=self signed certificate cert=/C=PL/ST=Lubelskie/L=Lublin/O=Futurehost/OU=IT/emailAddress=admin@futurehost.pl
2019-05-15 12:57:56 1hQrbg-0000gV-9k [91.244.71.100] SSL verify error: certificate name mismatch: DN="/C=PL/ST=Lubelskie/L=Lublin/O=Futurehost/OU=IT/emailAddress=admin@futurehost.pl" H="mail.sitte.pl"
2019-05-15 12:57:56 login authenticator failed for (User) [103.231.139.176]: 535 Incorrect authentication data (set_id=alpha@com.pl)
2019-05-15 12:57:56 1hQrbg-0000gV-9k => test@sitte.pl F=<felcia@felcia.co.uk> R=lookuphost T=remote_smtp S=4919 H=mail.sitte.pl [91.244.71.100] X=TLSv1:DHE-RSA-AES256-SHA:256 CV=no C="250 OK id=1hQrUm-000DBi-7Q"
2019-05-15 12:57:56 1hQrbg-0000gV-9k Completed

发送给*@o2.pl的电子邮件失败

2019-05-15 12:59:01 H=mx.sitte.com.pl (randki.felcia.co.uk) [5.187.55.123] incomplete transaction (connection lost) from <felcia@felcia.co.uk> for dzaro26@o2.pl felcia@felcia.co.uk
2019-05-15 12:59:01 unexpected disconnection while reading SMTP command from mx.sitte.com.pl (randki.felcia.co.uk) [5.187.55.123] D=12s

2 个答案:

答案 0 :(得分:1)

我认为您在这里混淆了两个问题。交付过程分为两个阶段-从PHPMailer到您的邮件服务器,以及从您的邮件服务器到收件人的邮件服务器。从您的第一个调试日志中,我可以看到第一阶段似乎运行良好-消息被正确接受。后两个示例来自邮件服务器的日志,而不是PHPMailer输出,因此它们发生在第二阶段。

这意味着您的问题不在PHPMailer或脚本中,而在邮件服务器或它自己的网络连接中。邮件服务器来来往往,而SMTP工作方式的一部分就是要解决错误,中断和延迟,这就是为什么在PHPMailer中使用本地邮件服务器是一个好主意的原因(正如您所做的那样)它可以处理这样的问题而无需您担心。这的确意味着您应密切注意邮件服务器的配置及其网络连接(通过日志),并且实现反弹处理程序也是一个好主意,这不是一件容易的事,以便您的应用可以访问听说此类延迟错误。

证书验证失败(我不确定您为什么将其描述为成功)可能是由过时的CA证书引起的;更新您的OS软件包,或安装受信任的根证书的全新副本(有关更多信息,请阅读PHPMailer故障排除指南)。最后一个看起来像一个不可靠的邮件服务器-您自己的邮件服务器应稍后再试发送-这就是邮件服务器的作用。

另外两件小事:这种问题只需要SMTPDebug = 2;更高的东西不必要地嘈杂。您还使用了旧版本的PHPMailer,因此请升级。

答案 1 :(得分:0)

配置SMTP服务器时出错。服务器管理员更改了一些设置(不幸的是,他没有提供确切的解决方案)。