Support » Plugin: Postman SMTP Mailer/Email Log » Bad Request(invalid_grant) error?

  • Hello, Postman quietly stopped delivering emails a little over a month ago and no one noticed until now. We’re using it with WPForms and the form data is capturing and storing just fine, just no notification emails are going out. The error listed under status for the ones that didn’t deliver is “Bad Request(invalid_grant).”

    Unfortunately, much of this flies over my head. Nothing changed in our settings and everything with the Google API Manager still matches up with what’s in the Postman settings. I did run the Connectivity test and everything seemed okay except perhaps this line:

    βœ… Port 25 can be used for SMTP to smtp.gmail.com. Warning: connected to *********************************************** instead of gmail.com.

    Not sure what that means. Also, below is the output of the Diagnostic test:


    OS: Linux php-v157.wc2.dfw3.stabletransit.com 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64
    PHP: Linux 5.6.24-0+deb8u1 C
    PHP Dependencies: iconv=Yes, spl_autoload=Yes, openssl=Yes, sockets=Yes, allow_url_fopen=Yes, mcrypt=Yes, zlib_encode=Yes
    WordPress: 4.6.1 en_US UTF-8
    WordPress Theme: Modern Portfolio Pro Theme
    WordPress Plugins: BackupBuddy, Genesis Simple Edits, Hello Bar (Official), iThemes Security Pro, iThemes Sync, Jetpack by WordPress.com, Meta Slider, Pin It Button for Pinterest, Postman SMTP, Simple Social Icons, Yoast SEO, WPForms Conditional Logic, WPForms Mailchimp, WPForms
    WordPress wp_mail Filter(s): wp_staticize_emoji_for_email
    Postman: 1.7.2
    Postman Sender Domain (Envelope|Message): gmail.com | gmail.com
    Postman Prevent Message Sender Override (Email|Name): No | No
    Postman Active Transport: SMTP (smtp:tls:oauth2://smtp.gmail.com:587)
    Postman Active Transport Status (Ready|Connected): Yes | Yes
    Postman Deliveries (Success|Fail): 344 | 81

    Anyone else getting this error and resolved sending issues?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jason Hendriks

    (@jasonhendriks)

    βœ… Port 25 can be used for SMTP to smtp.gmail.com. Warning: connected to *********************************************** instead of gmail.com.

    This warning means that another server has intercepted, and responded to, your request to gmail.com. This is known as a Man-In-The-Middle attack. I use the term loosely here, because it’s probably not a malicious effort, but rather your web host is capturing all TCP requests out on port 25 either for security (to reduce SPAM originating from their IPs) or for convenience.

    This is probably something new that they implemented, you guessed it, about a month ago.

    Bottom line, OAuth 2.0 will no longer work in this configuration.

    Thread Starter southernroutes

    (@southernroutes)

    Thanks for the quick reply, Jason! So, what would be my next steps in either getting this resolved or finding a more reliable method than OAth 2.0? For the record, the website is hosted at Rackspace. Thanks!

    Plugin Author Jason Hendriks

    (@jasonhendriks)

    I just noticed that your Postman is actually configured for port 587.

    In the Connectivity Test, do you get the warning on port 587 as well? Your post shows the warning on port 25 only.

    Thread Starter southernroutes

    (@southernroutes)

    Hi Jason, I probably should have pasted the whole output of the test. Here it is:

    Begin Test
    Transport Socket Status* Service Available Server ID Authentication
    None Login Plain CRAM-MD5 OAuth 2.0
    SMTP smtp.gmail.com:25 Open SMTP ************************************************* Yes No No No No
    SMTP smtp.gmail.com:465 Open πŸ”’ SMTPS gmail.com No Yes Yes No Yes
    SMTP smtp.gmail.com:587 Open πŸ”’ SMTP-STARTTLS gmail.com No Yes Yes No Yes
    Gmail API http://www.googleapis.com:443 Open πŸ”’ HTTPS googleapis.com n/a
    Mandrill API mandrillapp.com:443 Open πŸ”’ HTTPS mandrillapp.com n/a
    SendGrid API api.sendgrid.com:443 Open πŸ”’ HTTPS sendgrid.com n/a
    * According to portquiz.net

    Summary:

    βœ… Port 25 can be used for SMTP to smtp.gmail.com. Warning: connected to ************************************************* instead of gmail.com.
    βœ… πŸ”’ Port 587 can be used for SMTP to smtp.gmail.com.
    βœ… πŸ”’ Port 443 can be used with the Gmail API.
    βœ… πŸ”’ Port 443 can be used with the SendGrid API.
    βœ… πŸ”’ Port 443 can be used with the Mandrill API.
    βœ… πŸ”’ Port 465 can be used for SMTP to smtp.gmail.com.

    Thread Starter southernroutes

    (@southernroutes)

    Also, I should have said that we’re currently configured to send over port 587.

    postman settings

    Plugin Author Jason Hendriks

    (@jasonhendriks)

    Oh, 587 seems fine. That’s odd. Perhaps try re-creating your Google OAuth 2 ID.

    If it still doesn’t work, perhaps switch to the Gmail API on port 443?

    Thread Starter southernroutes

    (@southernroutes)

    Hi Jason, I created a new OAuth Client ID, entered the credentials and it appears to be working fine now. Thanks a lot for your help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Bad Request(invalid_grant) error?’ is closed to new replies.