סיכום מגבלת דוא"ל שנשלח בשעה

סיכום מבוסס בינה מלאכותית

The discussion revolves around adjusting the limit of summary emails sent per hour in Discourse. ozkn asks if the limit can be adjusted due to email delivery issues caused by a high number of users and a 800-email-per-hour server limit. neounix explains that the limit can be adjusted via the DISCOURSE_MAX_DIGESTS_ENQUEUED_PER_30_MINS_PER_SITE setting in the container build file, suggesting a value of 75 to stay under the limit. ozkn confirms setting it to 75, resulting in approximately 108,000 emails per month. neounix shares a custom solution involving a monkey patch to reduce the digest job interval from 30 to 5 minutes, allowing for smaller, more frequent email batches. neounix provides a link to the patch, and offers further assistance if needed. ozkn thanks neounix for the help.

Is the limit of the number of summary e-mails that can be sent up to 1 hour adjustable.
(sorry for bad english)

Not sure I understand what you are referring to , but see Configuring Activity Summary emails for more details on the summary emails and how they work.

Likely his email provider only allows x emails per hour and he wants to make sure Discourse sends fewer than that.

Here’s an answer to a similar question: How to set Email sending speed limit? - #2 by pfaffman

Yes @Jonathan5 I wanted to ask this. thanks for sharing. I will read the subject

Yes, this is currently easily set for digest emails using a Discourse global setting, for example to set your digests limit to 40 per hour you can set this in your container build file:

 DISCOURSE_MAX_DIGESTS_ENQUEUED_PER_30_MINS_PER_SITE: 20

This Discourse global setting for digests defaults to 10,000 every 30 minutes, and if you have a huge number of users, this can send out a lot of digests.

On our site, we use SendGrid (a paid plan) to send out 100,000 digests a month, plus or minus, so we set this to:

100,000 divided by 30 days per month divided by 24 hours a day divided by 2 per hour, so roughly: 60 digests per 30 minutes and it has been working smoothly.

See also:

Note: This requires a container rebuild / bootstrap so please consider this before making the change.

@neounix thank you so much. I was having a problem with e-mail because I have too many users.
I bought a mail server myself. There is a limit of 800 emails per hour. I was still having a problem.

You are welcome @ozkn !!

Just set that Discourse global setting to less than 400 per 30 minutes and you should be good to go.

We run digests in a “standalone SMTP channel” based on some monkey-patch’n plugin I wrote:; but since you are running the standard “single SMTP channel” config; you may need to go lower, naturally.

I did not risk it I set it to 75. This way, it sends 108,000 mails per month.

Digests emails a month…,

This global setting only applies to digests.

:slight_smile:

Hey @ozkn

OBTW, just to let you know.

I monkey patched the EnqueueDigestEmails Job on our main Discourse setup and set the digest Job interval to every 5 minutes versus the Discourse OOTB hardwired 30 minutes.

This meant, in our case, we could set the Global digest limiting var to 10 and send out 10 digests every 5 minutes versus 60 every 30 minutes. This gave me a very small number of, what I consider “advantages” doing it this way:

  • there is less load sending out 10 versus 60 at a time (or 50 versus 300, for example).
  • the admin email->sent log file is easier to read at a glance.
  • when we rebuild the container, the job always runs “on startup” so this lower number mitigated the initial job digest run to a much smaller number (since I could not figure out how to get the Discourse config to skip the initial running the job after the container rebuilds).

These are very small advantages, so I don’t recommend most people monkey patch the digest job for this small subjective advantage; but I prefer a 5 minute digest job interval over a 30 minute interval, and after testing for a few days, the mp works great and so, we are going to stay with the every 5 minutes interval.

Just to let you know, as some “small thing” to consider :slight_smile:

@neounix Thanks for your suggestion. where exactly can I make this setting.

Here you go @ozkn

GitHub - unixneo/discourse-neo-email-digest-monkey-patch: This plugin monkey patches the Discourse digest mailer job (EnqueueDigestEmails) · GitHub

thank you so much @neounix

You are welcome @ozkn

If you need further help with this monkey patch, since changing the digest mailer queueing interval from 30 to 5 minutes is not supported by Discourse, please contact me in this topic:

I have not yet made this patch a “polished plugin” with a README file and site settings, but in the future, I might make the interval a plugin site setting so it is not hard-wired to 5 minutes.