Count number of emails sent.

Created on 10 August 2008, about 16 years ago
Updated 20 July 2023, about 1 year ago

As a spam prevention measure, all hosts routinely limit the number of emails that can be sent per hour (per day, etc.)

The problem is that we can only guesstimate the number of emails that the Drupal site is sending. Basically, we count only the emails send by the modules using the mailing system the most (simplenews, subscriptions, etc.)

With simplenews, it's easy: we know how many subscribers there are to the newsletter, and how many newsletter are sent, how often.

With subscriptions.module, it's much less easy: the number of email sent will vary a lot: it depends on the amount of new content posted within the time frame, how many subscribers there are, etc.

To those, add all the regular mail sent (registration notification, password recovery, private messages, etc., etc.)

All together, it can be very tricky to guess the number of emails sent within the time frame that matters to the host.

At the very least, there should be a counter which would provide some statistics on the number of emails sent within specified periods of time. Maybe the way to go, is to have a new table {mail_sent} where each entry corresponds to a single email, with the fields: id, timestamp, module_who_sent_the_email, email_title, sender_uid, recipient_email_address, ...

Affected modules, all have a setting to set the number of emails that can be sent at every cron job. Ideally, we could have a site-wide setting to set the limit (per hour...) of emails that can be sent. Each email sent would be registered, and, if the limit has been reached for the time period, delayed until a bit later.

I set this as critical, because it is very easy in some circumstances to go over the limit set by the host. What's really critical, is that the site owner may not be aware of anything being amiss at all. Drupal is aware of any email being cancelled by the host, so the webmaster would be led to believe that everything is running smoothly, even though in effect a significant portion of the emails sent are never delivered.

I didn't find a 'mail system' in the component list.

Feature request
Status

Active

Version

11.0 🔥

Component
Mail 

Last updated 21 days ago

No maintainer
Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024