We built a new D8 site last year and it was able to send emails using the SMTP module through their GMail account. Just today we noticed that the email delivery has stopped working, despite no changes to the configuration. The customer just enabled both DKIM and SPF on their domain a week ago, so we suspect this has something to do with it.

CommentFileSizeAuthor
#7 smtp-n3227714-7.patch2.46 KBdamienmckenna

Issue fork smtp-3227714

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DamienMcKenna created an issue. See original summary.

tr’s picture

Status: Active » Postponed (maintainer needs more info)

Debug output would be helpful - what is the server reply?

damienmckenna’s picture

    SERVER -> CLIENT: 220 smtp-relay.gmail.com ESMTP ay18sm82854uab.3 - gsmtp
    CLIENT -> SERVER: EHLO appserver-f8651ef1-nginx-blahblah
    SERVER -> CLIENT: 250-smtp-relay.gmail.com at your service, [23.253.213.149] 250-SIZE 157286400 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8
    CLIENT -> SERVER: STARTTLS
    SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
    CLIENT -> SERVER: EHLO appserver-f8651ef1-nginx-blahblah
    SERVER -> CLIENT: 250-smtp-relay.gmail.com at your service, [23.253.213.149] 250-SIZE 157286400 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8
    CLIENT -> SERVER: AUTH LOGIN
    SERVER -> CLIENT: 334 VXNlcm5hbWU6
    CLIENT -> SERVER: [credentials hidden]
    SERVER -> CLIENT: 334 UGFzc3dvcmQ6
    CLIENT -> SERVER: [credentials hidden]
    SERVER -> CLIENT: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials ay18sm82854uab.3 - gsmtp
    SMTP ERROR: Password command failed: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials ay18sm82854uab.3 - gsmtp
    SMTP Error: Could not authenticate.

I'm not sure when it stopped working as the site sat waiting for six months between us building it and it launching, so it wasn't being used during that time so people weren't generating emails from it.

I've requested someone who has access to admin the gmail account can test it on their end, and hopefully this will turn into a documentation task.

tr’s picture

It looks like it might be a simple credentials mis-match, but gmail has always had some special requirements. If the redacted username and password are correct, then it might have to do with TLS version on your server or something along those lines. There are various documents available that show using SMTP with gmail, for example https://stevepolito.design/blog/drupal-configure-smtp-module-work-gmail-...

But if it used to work and now it doesn't I'm guessing either gmail changed their requirements or possibly your SMTP server isn't properly configured for DKIM/SPF. There's always a possibility of a problem with this module, but DKIM/SPF should be done on the server so that shouldn't make a difference to this module.

damienmckenna’s picture

Thanks for the link to Steve's blog post, the extra gmail setup details are likely what's causing the problem, I'll share it with my contacts. Once we sort it out I'll provide a patch to update the documentation with any relevant notes.

damienmckenna’s picture

Our contact went through and double-checked all of the credentials. This morning I was able to get further, it now complains about the hostname not being approved for relaying email. So, we're getting there.

damienmckenna’s picture

Title: Email delivery stopped working, possible related to DKIM or SPF » Document extra steps required for GMail setup
Component: Miscellaneous » Documentation
Category: Support request » Task
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.46 KB

Here are some improvements to the README.txt on GMail setup. Neither the client nor I can understand why it worked before but didn't work until extra steps were taken this morning.

damienmckenna’s picture

Cross-referencing two issues that I needed in order to get this working - the debug issue's patch makes it possible to actually see the debug output, while the other one fixes a critical bug in the current dev release.

bluegeek9 made their first commit to this issue’s fork.

bluegeek9’s picture

Assigned: Unassigned » bluegeek9

  • bluegeek9 committed 0b16538c on 8.x-1.x
    feat: #3227714 Document extra steps required for GMail setup
    
bluegeek9’s picture

Assigned: bluegeek9 » Unassigned
Status: Needs review » Fixed
//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support makes this project sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:
  • Triage issues and adding more context to existing issues.
  • Flagging SMTP as a favorite on the project page to help others discover it and show your support.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.