We have a project to set up around 5,000 plus email IDs for an educational institution. Emails are meant mostly for receiving mails, and the instituition wants to set up some rule that no email id can send more than 10 emails in an hour, and not more than 50 emails in a day.

I have looked at number of open source solutions but could not find specific to set a mail restriction per email id. There are a few which are outbound spam specific.

We would prefer fully open source solutions and free.

If nothing of that sort is available, can someone suggest the right steps to create one on top of any of the presently available mail sending/spam filtering frameworks?


Solution 1:

Policyd has Quota module.

  • Sender:user@domain

    • A counter will be created for each sender email address and counters for each individual sender will be tracked.

For 10 emails per user per hour use this in the [Quotas] section in the configuration file:

Policy: Default Outbound Policy
Track: Sender:user@domain
Period: 3600
Type: MessageCount
CounterLimit: 10

There's also bejelith/send_rate_policyd by Simone Caruso on GitHub.