Turning off email for a user

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?

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.

3 Likes

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.

I got the same issue in the past and i have just changed these 2 options (+summary email)to “never” in their profile, in the tab “emails”.

1 Like

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.