Activation email not received, sometimes, for some people, because DMARC was broken

AI-generated summary

Users reported intermittent delays or failures in receiving activation emails, particularly on Gmail, despite successful delivery to other providers or after resending. Initial tests on try.discourse.org and production sites showed inconsistent behavior — some users received emails immediately, others only after resending, and some not at all. Investigations pointed toward Gmail’s unpredictable delivery patterns, with ClawdiaWolf and Stephen confirming this is a common, frustrating issue — especially for new domains or accounts. Don suggested analyzing email headers or server logs for root causes, while RGJ noted greylisting as a possible culprit elsewhere. Eventually, pfaffman discovered the real issue: DMARC was misconfigured for the notification_email address. Though a mail-tester score of 9.8/10 seemed acceptable, it masked the underlying DMARC failure. Stephen joked about the pitfalls of trusting numerical scores, prompting pfaffman to lament the oversight — and Stephen to admit his own obsession with perfection might have helped avoid the issue. The thread ends with lighthearted banter, underscoring the frustration and relief of finally identifying the root cause: broken DMARC, not Gmail’s quirks.

I had a complaint that a user had tried multiple times to register but never got a activation email.

I tried on that site and didn’t get an email until I clicked the “resend” button. I saw the same behavior on try.discourse.org. I think I’ve seen this for a while but always ignored it.

I haven’t checked the source yet to see if I can find an explanation.

I can’t replicate the behavior on any of my production or test sites :confused:

Latest test-passed version, using SendGrid as SMTP provider

At most the emails reach “Promotions” on Gmail but I do not complain



Any clues in Logs or Sidekiq?

Well, it appears that Gmail didn’t deliver the first message until the second one had been sent. This was the case both on try and the site in question.

And then I tested again using mail-tester as the email address and messages were delivered right away. :person_shrugging:

Seemed like an unlikely bug, but I guess gmail just slows down mail from new addresses, or something. The user claimed to have tried on several email addresses. . .

Just tried this on try and when I went to Gmail the confirmation email was already waiting for me in the top of my inbox.

Well, harumph. I have fewer and fewer explanations.

It’s a Gmail thing. For some reason it will randomly delay messages for no apparent reason. I’ve seen this a lot over the years even when sending emails to myself via the web interface.

Yep we see this regularly with Gmail, particularly on new installations.

It’s a constant source of headache.

We had one install recently where the admin was configured against a new gmail account. It could send email to the site, but never received any. Other gmail accounts could interact without problem.

I guess you get what you pay for.

Hello,

Probably useful if you check the email header when it’s arrive with delay to investigate. On this site you can check the email’s path with timestamps etc… If the email not received maybe a good idea to check the mail logs for the reason.

I would indeed be very interested to see those message headers. I have never experienced this, not with Gmail and not with other providers, only with providers that implement greylisting the first message can be delayed.

As if this topic weren’t allready embarrassing enough . . . . DMARC was broken for the notification_email address. I did a mail test, but glossed over the DMARC warning (a 9.8/10 seemed pretty good?)

Numerical scores are the realm of journalists and salespeople!

Indeed. Rub it in, @Stephen! :crying_cat_face:

Sorry, I’m one of those “so how do I get that last 2%?” types.

Truly it’s a curse. This may be one of the few occasions where it’s justifiable.

If anything it’s the fault of poor score weighing!

Well, this is one of those times when that curse would be a life saver! :beer: