• THE PROBLEM
    ============

    Gmail servers are blocking some emails sent (through the Gmail API) by the Postman SMTP Mailer/Email Log plugin, it has been confirmed by Google engineers.

    They state that out of many connections started by the plugin, a few of them are blocked due to the fact the plugin is using a EHLO argument of “localhost.

    They explain that Gmail servers check for the frequency of the EHLO/HELO argument (for “localhost“) and if it hits certain threshold it starts rejecting some of these connections. At the same time they clarify that their servers do not associate the EHLO/HELO argument with the IP address, that means that if within a time window there are different users using “localhost” as EHLO/HELO argument then they start blocking some of these connections.

    I have done some research and I can corroborate Google engineer’s argument of “localhost” as EHLO/HELO argument not being a good practice (serverfaul).

    THE SOLUTION
    ============

    Changing the EHLO argument to mydomain.com (senders domain) fixes the problem.

    I solved it in a very rudimentary way (I am not a programmer), editing:

    postman-smtp/Postman/Postman-Mail/Zend-1.12.10/Mail/Protocol/Smtp.php
    Adding $host=‘mydomain.com’; after line 196.

    HOW TO KNOW IF YOU HAVE BEEN AFFECTED BY THIS ISSUE
    ===================================================

    This issue might have been affecting a lot of users without noticing it.

    I installed Postman SMTP and set it up to work using OAuth 2 and Gmail.

    I have always kept an eye on my email log (looking at the sessions transcripts in case something has gone wrong). All along 2 months (since I installed the plugin) I could see that between 5% and 10% of my outbound emails were being rejected by Gmail servers. I even opened a support topic here. I got in touch with Google support and they escalated it to their engineers…the rest has been told above.

    So if you are wondering if you have been affected, just check your email log and if you find a Status of “Could not read from smtp-relay.gmail.com” then look at the session transcript and search for a line saying:

    “421 4.7.0 Try again later, closing connection. (EHLO) XXXXXXXXX.X – gsmtp (right after “EHLO localhost”).

    • This topic was modified 7 years, 8 months ago by diegocanal.
    • This topic was modified 7 years, 8 months ago by diegocanal.
    • This topic was modified 7 years, 8 months ago by diegocanal.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Thanks for sharing this valuable information.
    Do you think this fix would work for office 365? Using the SMTP.Office365.com

    Thanks!

    Thread Starter diegocanal

    (@diegocanal)

    I am not sure but I think that –if, in your session transcripts, you see that Postman is using localhost as EHLO argument, which is not a good practice in smtp connections– you should apply the fix as it is an improvement, no matter the mail server you are connecting to.

    What does your mail log say? Are there any connections with errors?

    I’ve been trying to track down the solution to my issue as well. I noticed that running the connectivity test gave inconsistent results, sometimes within the same day, and lots of timeout errors. This was after making no changes, so sometimes it works, other times not. My hosting assured me that they are not blocking any of the ports from the test and I too was using Gmail and OAuth 2. What you are saying, however, would make sense, that when mine started failing it was one of the blocked connections, it would also explain why it would happen so inconsistently.

    I’ve implemented your solution and everything is working at the moment. How can I know for sure that it will stay this way? Or do I just keep checking? The client is getting a bit agitated with this reoccurring issue.

    Thanks for all the info!

    Thread Starter diegocanal

    (@diegocanal)

    @crayonbox:

    I noticed that running the connectivity test gave inconsistent results

    I never got errors doing “Connectivity Test” (although I did not do many) but I used to get errors when performing “Send a Test Email” several times (about 20) in a row.

    I’ve implemented your solution and everything is working at the moment. How can I know for sure that it will stay this way? Or do I just keep checking?

    Please it would be great if you could regularly check your mail log and post here the results once you think they are conclusive –give it some days or weeks, it depends on your previous experience (error rate) and the amount on emails sent–.

    Thanks for your feedback and good luck!

    Plugin Author Jason Hendriks

    (@jasonhendriks)

    @diegocanal thank you for the report.

    You are right, I have always passed localhost as the sender for the Gmail API, and have never seen the error “421 4.7.0 Try again later, closing connection.”

    I will make an update to use the domain of the configured address instead.

    Thank-you!

    Thread Starter diegocanal

    (@diegocanal)

    @jasonhendriks, what a relief! I was starting to think this thread might have ended up unnoticed –I even tried to contact you via slack–.

    Using the domain of the configured address sounds like a good solution.

    I thank you for developing/maintaining such an amazing and useful plugin!

    Thanks for letting us know that this change will be made. Any idea of the implementation time period?

    I just posted about this same issue. I made a small change to a different file in order to use the domain name of the from email address.

    https://www.ads-software.com/support/topic/g-suitegmail-smtp-relay-try-again-later-issue/

    Thread Starter diegocanal

    (@diegocanal)

    @n8man thanks for the heads up!

    Fixed the bug, like to hear your feedbacks or anyone else.

    https://github.com/yehudah/Postman-SMTP

    Thread Starter diegocanal

    (@diegocanal)

    Thank you @yehudah for being so kind as to fix this for all of us!

    I will carry on messaging you about this topic in https://github.com/yehudah/Postman-SMTP/issues/2

    Thread Starter diegocanal

    (@diegocanal)

    BIG NEWS!

    The fork (fixed version) by @yehudah (props to him!) has got approved in the WordPress Directory. This is so great as (in the words of @buzztone) it definitely provides a much easier option for most WordPress users to replace their current Postman-SMTP install ( which they should do urgently because it has a serious security vulnerability). You can find it in https://www.ads-software.com/plugins/post-smtp/.

    The Github repo has been moved here: https://github.com/yehudah/Post-SMTP.

    All of us should be so excited that now we know Postman SMTP Mailer/Email Log is going to survive, with its new shiny name Post SMTP Mailer/Email Log.

    Long life to Post SMTP Mailer/Email Log! Thank you @yehudah!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Google engineers confirm some of the emails sent by Postman are being blocked’ is closed to new replies.