I have a Django installation that is configured to email administrators (five of us) whenever an error occurs. All of the generated emails are directed to postfix and then on to the mail server for distribution. Unfortunately, we encountered an error that looped over the weekend, sending nearly 500,000 emails.
With that being said, I'd like to throttle postfix to send emails at a reduced rate. Obviously, there are other ways to tackle this issue, but I'd like to start with postfix since it feels like the path of least resistance.
My first attempt at meeting this objective was adding these config parameters to postfix/anvil:
smtpd_client_message_rate_limit = 5 anvil_rate_time_limit = 60s
I wrote a simple program to send one email per second, hoping that the params above would send out one email every five seconds. Unfortunately, that didn't work, which brought me here.
Any advice on this matter is greatly appreciated.