Limit number of emails
digi24 - August 7, 2009 - 19:26
| Project: | Logging and alerts |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Dave Reid |
| Status: | active |
Jump to:
Description
Hi,
I like the email logging functionality. This is great to notice when something is going wrong with less frequented sites.
However, cron, menu rebuilds etc. may cause a real flood of emails as errors are triggered for every failed sql query. Of course one could argue that the error logic of some modules is not right, but my wish would be to limit the number of emails sent in a given interval.
eg. do net send more then 5 emails per hour. This is sufficient to notice that something is not ok, while keeping the mailbox clean.
This functionality should be ideally achieed without solely relying on the database (typical point of failure).

#1
I've been working on this exact feature. I think we could name the feature "maximum e-mail frequency" and have the following options:
- Immediately (send an e-mail for every single warning)
- Whenever cron is run
- 5 minutes
- 15 minutes
- 30 minutes
- 1 hour
- 3 hours
- 6 hours
- 12 hours
- 1 day
- 1 week
I'm welcome to suggestions and improvements for the option's description
#2
Hey Dave,
your options are good. I am just not sure about your description. I'd suggest to send out an email immediately, unless a "block signal" has been set. Given certain constellations, a cron run may never occur.
However I think the major task will be, where to store the information on emails sent, while keeping up compatibility with different drupal installations.
My idea would be to create email-logs in both database and file system whenever an email is sent. Before sending out the next email, I'd check the max of the corresponding timestamps.
Logically, the configuration would have to be stored in two places too