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.

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

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么