I have some users with defunct or undeliverable email addresses. I turn off notifications in their preference but mail to them still goes out. Am I going crazy? Or does Discourse keep trying to send failed emails forever? What cold be going on?
AI-generated summary
Users are discussing issues with email notifications persisting for users with undeliverable email addresses, despite disabling notifications in their preferences. Andro notes that emails continue to be sent, suspecting Discourse retries indefinitely. HAWK suggests deactivating accounts. Simon_Manning explains that retry behavior depends on the email provider and asks about bounce handling. He clarifies that Discourse stops sending emails when bounce scores exceed a threshold, which requires proper bounce setup—either via bounce emails to mail-receiver or webhooks. David_Ghost recommends setting email preferences to “never” as a workaround. Andro confirms they don’t see bounces in Discourse, even with a local Postfix setup and mail-receiver, and asks for guidance on configuring bounce delivery correctly. Simon_Manning advises matching the DISCOURSE_NOTIFICATION_EMAIL domain with the mail-receiver’s domain. Andro follows up asking whether this setup populates the bounced email log.
Could you provide a bit more info? Which emails is it sending?
And it may make more sense to just deactivate their accounts if they’re not able to log in anyway.
Any email. And yes, I have taken to deactivating the accounts. Mystery not solved - without reading the source code I suspect Discourse keeps retrying to send for some time. But that is only a guess.
Are they actually the same email being retried or are they similar emails, e.g. an email for the first reply in a topic, then later an email for a second reply?
Where are you seeing the additional emails? Discourse logs, your email provider logs or somewhere else?
If it’s your email provider, depending on the delivery failure, that might be perfectly normal - temporary failures will be retried periodically for an amount of time before eventually bouncing, how many times and over what period will be entirely down to configuration by your email provider.
Do you have bounces set up correctly to be delivered to Discourse, either by having bounce emails reaching mail-receiver or using webhooks?
Ordinarily if Discourse is notified of these failures, the bounce score for a user will build and past a certain threshold (bounce_score_threshold setting), Discourse will stop trying to send emails to that user.
Probably not.
Do you have any pointers on necessary setup for that, or tutorials, etc? I am using a local Postfix instance for sending mail from Discourse and the mail-receiver app for receiving.
Assuming your postfix configuration isn’t doing something to alter bounce delivery, I believe having DISCOURSE_NOTIFICATION_EMAIL in app.yml using the same domain that reaches mail-receiver should be all it needs.
E.g. if your mail-receiver.yml config uses MAIL_DOMAIN: discourse.example.com (and your DNS records result in email to that domain being delivered to mail-receiver), DISCOURSE_NOTIFICATION_EMAIL should look something like whatever@discourse.example.com
@Simon_Manning Does that put them into the Bounced email log in Discourse though?
Before I changed to Postfix I used to see bounces there, now nothing.
