Daily limits for outgoing mails per user

I just checked in a feature that puts a cap on the number of emails we can send a user per day.

https://github.com/discourse/discourse/commit/c095304d6df578edff399cf19876385e9aabaf06

Out of the box max_emails_per_day_per_user of 100 emails per day is applied. You may bypass this limit by setting it to 0 or make it bigger.

When a user hits the limit we will display

WARNING: you reached the limit of 100 daily emails. Further emails notifications will be suppressed.

This is displayed at the bottom of the 100th emails.

Cap does not apply to “forgot password” (where a different cap applies) - it applies to email notifications and mailing list notifications.

May your sendgrid bills be cheaper…

11 Likes

You added the #feedback tag, so I have a question…why? How many users do you see getting 100+ emails in a day (on Meta or elsewhere)?

Note: I am not against this feature in any way, just curious why it is needed.

This issue usually creeps in on mega active sites like BBS, heloforos, turtlerock and gearbox, probably 10-20 users hit that limit daily.

2 Likes

Does this affect site performance, or is the main goal to lower email costs?

The goals are:

  1. Reduce risk of burning your domains email because users get so annoyed with you that they start flagging the flood of mails they ask for as spam.

  2. We rate limit all things, email was very oddly absent from our general rate limit pattern.

  3. Lower email costs for self hosting people, ability to better control how much email each user can eat

  4. Encourage users to stop watching too much stuff, disable mailing list mode on large sites and disable the “notify via email even if I am around” feature.

7 Likes

So if part of the goal is to lower how much users watch, and disable 2 features, why not limit how much a user can watch and remove the 2 features? I can understand mailing list mode, and also can see how it is an issue on large sites, but I never got the “notify via email even if I am around” feature…

On the vast majority of Discourse sites none of this is a problem.

When you are bootstrapping a site you kind of want the volume to be at 11. The issue is that some settings that are OK on a small site are terrible on a huge site.

This feature is an equalizer.

2 Likes

Please don’t
I Watch plenty and I’d like to keep it that way.

But of course I visit every day and have disabled all emails so getting a flood of emails is not a problem for me.

I added Watch via my Preferences page,

I disabled emails via my Preferences page.

Are there many that add Watch via the buttons and are unaware of the email settings in their Preference page?

2 Likes

In our research the “mailing list mode” was the greatest offender by far, where users get one email for every single post in the system. It is possible to get a fair number of emails (way more than 100/day) by watching a busy category (or two) but mailing list mode is absolutely nuclear, incredibly dangerous on a busy site, very much akin to The Giant Red Button… thousands of emails a day, in one tiny click.

We are adding a giant scary UI warning to this option very soon so it is not clicked accidentally.

4 Likes

Awesome!

May I add that this is an excellent safety feature against the extremely dangerous user setting:

Send me an email for every new post (unless I mute the topic or category)

One question - this settings does not limit the amount of private message email notifications, right?

I am actually considering to use a very strict daily email limit. Basically a user would only be notified once or a few times max, as we he comes to the site he’ll see the profile icon notifications of all the missed activity.

Would you agree, @sam?

This limits both messages and and general post notifications. So yeah, by design it limits both. You could go stricter, but going down to 1 would be a bit harsh.

Hm…in my opinion, at least on first thought, PMs should not be a part of this limitation/quota.

A private message potentially contains information of significant personal value, as a decision has been made about privacy, and therefore I feel a notification should always be delivered.

I disagree, we see some people use PMs as a “chat channel” and they can cause a flood of emails for people who participate in the PMs.

Having some limit in place protects you to a degree. Besides the “green” notification will still be there when you visit the site.

4 Likes

Perhaps the limiter should separate for PMs and public posts? Or an option to exclude PMs from the limit?

I get your private chatting use case issue. It seems that your customers have really developed interesting cultures (recent private topic max length limit). That does not invalidate my point though, which is that a PM potentially contains information of higher personal value, even if some people exploit the feature to other purposes.

I like this. Nice idea, and thanks! :rocket:

2 Likes

Very good sam :fireworks:

We are sending more than 3k emails a day (after nerfing the two email settings a lot).

Setting this to something like 3 or 5 will help a lot.

3 Likes

Clearly my site must be different, but as it grew out of a mailing list, myself and several of the active users very much use “mailing list mode” as a primary way of using the forum.

The whole purpose of the “Send me an email for every new post” is kind of defeated if it then doesn’t actually send an email for every new post, so I’m at least glad to hear this setting can be disabled.

100 mails a day is a lot of mails, do you ever reach that scale?

It does not look like it. The site has had 750 posts over the last 30 days, hence average of 25/day - even allowing for spikes it probably would not get to 100/day.

However, that said, I want to see every post in my mailbox - my mailbox is my own archive of the site. Even if the site was doing ten times the traffic, I’d want to see every post in my mailbox, because my mailbox is how I process the site. And its the same way several of the other volunteers process the site.

Which is fair enough, and totally your call, hence it is a site setting

3 Likes