Email allegedly sent without SMTP settings

AI-generated summary

dandv reported that signing up an admin user and re-sending activation emails appeared successful on a new Discourse instance, despite missing valid DISCOURSE_SMTP_* settings, resulting in no actual emails being sent. omfg hypothesized that the system only checks for the existence of DISCOURSE_SMTP_ADDRESS, linking to the relevant Docker template code. codinghorror suggested this was likely a “Garbage In, Garbage Out” (GIGO) scenario rather than a bug, asking for specific configuration details. sam explained that because mail is sent via background jobs, there is no immediate way to alert end-users of failures, though he noted the volume of alerts for admins could be increased and that flagging sudden mail stoppages would be valuable. codinghorror countered that recurring errors should already trigger alerts via Logster, referencing ongoing work by tgxworld. Finally, dandv confirmed omfg’s theory, stating that while having only the address set is technically “Works As Intended” (WAI), most SMTP servers practically require username and password credentials to function.

I’ve just spawned a new instance of Discourse and didn’t have valid settings for DISCOURSE_SMTP_*.

However, signing up the admin user allegedly worked:

(of course, no email had been sent)

Same problem with re-sending the activation email:

2 Likes

Could it be because only DISCOURSE_SMTP_ADDRESS is checked to exist?

What exact settings did you have? I don’t feel this is a bug, more of GIGO.

Mail is sent in a background job, there is no simple way of alerting an end user about this kind of issue

We could probably raise the volume for admins

It is flag worthy when mail suddenly stops working

1 Like

That would already be covered by logster escalating alerts for periods with lots and lots of recurring errors, the work that @tgxworld is doing.

1 Like

Exactly. I had all the other SMTP settings commented out, so in theory this is WAI, but in practice most SMTP servers will require user/pass too.