doumen5491 2017-03-22 16:42
浏览 121
已采纳

Gmail smtp验证不正确

I'm trying to use smtp.gmail to send mail from a php script(swiftMailer and PHPMailer) on my shared host. The reason for this is emails from my host smtp are being blocked by several providers. I am sending low volume to members of a club once per month.
Using wamp locally everything works. From my host this is the response "Expected response code 235 but got code "535", with message "535 Incorrect authentication data " (code: 535)"

Here's the successful local host log:

++ Starting Swift_SmtpTransport << 220 smtp.gmail.com ESMTP t128sm578436oie.10 - gsmtp >> EHLO smtp.gmail.com << 250-smtp.gmail.com at your service, [2600:100b:b01d:4f88:c868:fff1:ec38:5954] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 >> STARTTLS << 220 2.0.0 Ready to start TLS >> EHLO smtp.gmail.com << 250-smtp.gmail.com at your service, [2600:100b:b01d:4f88:c868:fff1:ec38:5954] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 >> AUTH LOGIN << 334 VXNlcm5hbWU6 >> xxx << 334 UGFzc3dvcmQ6 >> xxx== << 235 2.7.0 Accepted

Here's the failed host log:

++ Starting Swift_SmtpTransport << 220-omniark.omniark.com ESMTP Exim 4.87 #1 Wed, 22 Mar 2017 09:31:09 -0500 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. >> EHLO smtp.gmail.com << 250-omniark.omniark.com Hello omniark.omniark.com [50.22.8.114] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250-STARTTLS 250 HELP >> STARTTLS << 220 TLS go ahead >> EHLO smtp.gmail.com << 250-omniark.omniark.com Hello omniark.omniark.com [50.22.8.114] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250 HELP >> AUTH LOGIN << 334 VXNlcm5hbWU6 >> xxx << 334 UGFzc3dvcmQ6 >> xxx== << 535 Incorrect authentication data !! Expected response code 235 but got code "535", with message "535 Incorrect authentication data " (code: 535)

Searching some more I came across this:

Incorrect Authentication Data can result when mailbox permissions are changed due to migrations, or an account/server update. This can be quickly fixed by running the /scripts/mailperm from terminal, or by going to WHM > Email > Repair Mailbox permissions.

Since i don't have WHM access I would appreciate some guidance on this issue from someone with the know how that I don't posses.

Thank you for your attention in advance.

  • 写回答

1条回答 默认 最新

  • doupiao9318 2017-03-22 17:18
    关注

    Look at the output from that second session. The first thing the server says is that it is omniark.omniark.com, not smtp.gmail.com. This means that your connection is being intercepted and redirected to your ISP's mail server, where, of course, your gmail credentials will not work.

    Before you get that far, you should have had a certificate validation failure because the host name does not match the certificate name. If this was allowed to happen, you need to fix your config to always verify certificates as otherwise you are effectively the victim of an MITM attack and have given away your credentials.

    In short, your ISP is blocking your outbound connection. While I can see you're using SwiftMailer, this is covered in PHPMailer's troubleshooting guide.

    I edited out your ID and password from the SMTP transcripts; you should change your password now.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!