我很难让mandrill SMTP可靠地发送。或者更确切地说,每次都进行身份验证。当它进行身份验证时,电子邮件正常工作
我可以很好地运行发送脚本,然后一个接一个地连续运行2到3次。然后它没有进行身份验证。但有时它不会立即进行身份验证。
我想也许只是因为它认为我滥用它并在短时间内封锁了我。
但我可以看到,自从我开始在我的网站上使用mandrill SMTP时,其验证失败率是常规的。
尝试在域中归因的SPF和dmik文本。这没有帮助
环顾四周,我无法看到其他人遇到此问题,但按照这个速度,我当然无法将mandrill用于SMTP。
有人可以说明为什么会发生这种情况的原因吗?我的凭据是100%准确的,我不认为我发送了很多电子邮件。
使用另一个mandrill帐户在另一台服务器上遇到同样的问题。
注意:我使用的是phpmailer
示例调试错误:
2014-12-06 08:52:59 Connection: opening to smtp.mandrillapp.com:587, t=300, opt=array (
)
2014-12-06 08:52:59 Connection: opened
2014-12-06 08:52:59 SERVER -> CLIENT: 220 smtp.mandrillapp.com ESMTP
2014-12-06 08:52:59 CLIENT -> SERVER: EHLO fakemail.com
2014-12-06 08:52:59 SERVER -> CLIENT: 250-ip-10-243-6-11
250-PIPELINING
250-SIZE 26214400
250-STARTTLS
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250 8BITMIME
2014-12-06 08:52:59 CLIENT -> SERVER: AUTH LOGIN
2014-12-06 08:52:59 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2014-12-06 08:52:59 CLIENT -> SERVER: bWVAZG91Z25vcmZvbGsuY29tLmF1
2014-12-06 08:52:59 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2014-12-06 08:52:59 CLIENT -> SERVER: REDACTED
2014-12-06 08:53:01 SERVER -> CLIENT: 435 4.7.8 Error: authentication failed: UGFzc3dvcmQ6
2014-12-06 08:53:01 SMTP ERROR: Password command failed: 435 4.7.8 Error: authentication failed: UGFzc3dvcmQ6
2014-12-06 08:53:01 CLIENT -> SERVER: QUIT
2014-12-06 08:53:01 SERVER -> CLIENT: 221 2.0.0 Bye
2014-12-06 08:53:01 Connection: closed
2014-12-06 08:53:01 SMTP connect() failed.
Mailer Error: SMTP connect() failed.
示例正确发送:
2014-12-06 08:52:33 Connection: opening to smtp.mandrillapp.com:587, t=300, opt=array (
)
2014-12-06 08:52:33 Connection: opened
2014-12-06 08:52:33 SERVER -> CLIENT: 220 smtp.mandrillapp.com ESMTP
2014-12-06 08:52:33 CLIENT -> SERVER: EHLO fakemail.com
2014-12-06 08:52:33 SERVER -> CLIENT: 250-ip-10-250-28-124
250-PIPELINING
250-SIZE 26214400
250-STARTTLS
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250 8BITMIME
2014-12-06 08:52:33 CLIENT -> SERVER: AUTH LOGIN
2014-12-06 08:52:33 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2014-12-06 08:52:33 CLIENT -> SERVER: bWVAZG91Z25vcmZvbGsuY29tLmF1
2014-12-06 08:52:33 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2014-12-06 08:52:33 CLIENT -> SERVER: REDACTED
2014-12-06 08:52:33 SERVER -> CLIENT: 235 2.7.0 Authentication successful
2014-12-06 08:52:33 CLIENT -> SERVER: MAIL FROM:<me@fakemail.com>
2014-12-06 08:52:33 SERVER -> CLIENT: 250 2.1.0 Ok
2014-12-06 08:52:33 CLIENT -> SERVER: RCPT TO:<me@fakemail.com>
2014-12-06 08:52:33 SERVER -> CLIENT: 250 2.1.5 Ok
2014-12-06 08:52:33 CLIENT -> SERVER: DATA
2014-12-06 08:52:33 SERVER -> CLIENT: 354 End data with <CR><LF>.<CR><LF>
2014-12-06 08:52:33 CLIENT -> SERVER: Date: Sat, 6 Dec 2014 19:52:33 +1100
2014-12-06 08:52:33 CLIENT -> SERVER: To: Test <me@fakemail.com>
2014-12-06 08:52:33 CLIENT -> SERVER: From: Test <me@fakemail.com>
2014-12-06 08:52:33 CLIENT -> SERVER: Subject: Here is the subject
2014-12-06 08:52:33 CLIENT -> SERVER: Message-ID: <0a8f3c40575be98668d8ea6fb03f4bfc@fakemail.com>
2014-12-06 08:52:33 CLIENT -> SERVER: X-Priority: 3
2014-12-06 08:52:33 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.9 (https://github.com/PHPMailer/PHPMailer/)
2014-12-06 08:52:33 CLIENT -> SERVER: MIME-Version: 1.0
2014-12-06 08:52:33 CLIENT -> SERVER: Content-Type: multipart/alternative;
2014-12-06 08:52:33 CLIENT -> SERVER: boundary="b1_0a8f3c40575be98668d8ea6fb03f4bfc"
2014-12-06 08:52:33 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: --b1_0a8f3c40575be98668d8ea6fb03f4bfc
2014-12-06 08:52:33 CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: This is the body in plain text for non-HTML mail clients
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: --b1_0a8f3c40575be98668d8ea6fb03f4bfc
2014-12-06 08:52:33 CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: This is the HTML message body <strong>in bold!</strong>
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: --b1_0a8f3c40575be98668d8ea6fb03f4bfc--
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: .
2014-12-06 08:52:33 SERVER -> CLIENT: 250 2.0.0 Ok: queued as 109BC180070
2014-12-06 08:52:33 CLIENT -> SERVER: QUIT
2014-12-06 08:52:33 SERVER -> CLIENT: 221 2.0.0 Bye
2014-12-06 08:52:33 Connection: closed
Message sent!
我尝试每5秒触发一次电子邮件。它没有发送过10次中的3次。
1分钟后,我每10秒钟尝试一次。 10个中有8个没有发送。
答案 0 :(得分:0)
由于它是断断续续的,它看起来肯定是一个问题。设置SMTPDebug = 3
以查看整个SMTP会话。
从您给出的片面视图来看,它看起来并不像您正在使用TLS,并且在启动TLS之前通常不允许进行身份验证,但我可以看到服务器说它会执行它。我认为允许auth没有TLS作为安全漏洞,当然不是你需要允许的东西。
另外请确保您使用的是最新的PHPMailer(5.2.9 +)。