> From: Wietse Venema <[email protected]> > To: Postfix users <[email protected]> > Cc: > Sent: Saturday, August 13, 2011 2:40 PM > Subject: Re: Outbound mail rate limits by user > > Steve Fatula: >> This seems to have been discussed before, but, I have a small >> twist. On a system I am working on, there are many users. These >> users can send mail via some email client or webmail, and, via >> command line programs (sendmail) or PHP, mailing list program, >> etc. I need to be able to limit outbound emails sent in any of the >> methods to say 100 per hour for a given user.?The limit would be >> by user name, so, the SASL user name might be steve, and, if mail >> is sent by sendmail via command line, it would also be steve. >> >> So, a policy server can't work since it doesn't deal with command >> line type locally submitted email. A milter MIGHT work since it can >> be smtpd or non smtpd, not sure, have not found one yet that might >> do the trick. ? >> >> Failing that, or some other simple solution, the simplest thing I >> can think of would be to simply watch the log file via a program >> and by parsing it as it gets written to, and keeping a count. If >> the limit is reached, can set postfix setting to disable locally >> submitted mail for the user, and, can set policy server to not >> accept mail from submission port. Should be pretty efficient.? >> >> Is there is an easier or more elegant way someone might be using? > > With Postfix 2.7 and later use a per-sender FILTER action without > next-hop destination: > > [email protected] FILTER sender-class-1: > > In master.cf specify a sender-class-1 SMTP client. > > sender-class-1 unix - - n - - smtp > > In main.cf specify sender-class-1_destination_rate_delay=1 to limit > the per-sender rate to one message per second. >
Won't this mean I would need a separate class for every sender? And if I have 1,000 senders (which I do)? My limit needs to be by sender, so, any given sender can send a certain amount, say 100 per hour which is just an example. So, 5 senders could send 500 per hour combined. If so, is there any other solution?
