1

Is it possible to limit the users to send total email in a month/day. I am trying to enforced marketing users to send newsletter according to their assigned quota.

Example 1. user1@example.com: can send only 100 emails a day & 3000 emails in a month. 2. user2@example.com: can send only 200 emails a day & 6000 emails in a month.

VPS: Centos6 MTA: postfix

user103373
  • 198
  • 6
  • 19
  • Since you haven't mentioned what sort of authentication you use (if any) you can use something like this: `Policy: Default Outbound Policy Track: Sender:user1@example.com Period: Monthly MessageCountLimit: 3000 MessageSizeLimit: Verdict: REJECT Data: "Sending limit exceeded"` – NickW Apr 24 '14 at 13:19
  • You also need to be sure you enable `accounting` in policyd.conf, and load the Postfix protocol, and ensure that this is set up as both `smtpd_recipient_restrictions` and `smtpd_end_of_data_restrictions:` pointing to `check_policy_service inet:127.0.0.1:10031` – NickW Apr 24 '14 at 13:23

1 Answers1

4

The tool you need is the cluebringer otherwise known as policyd. It will allow you to assign quotas of all sorts (and many other functions), and importantly, allows you to count users by more immutable criteria, like their SASLUsername, allowing you to be fairly confident that people won't be able to sneak around limits by changing sending email.

NickW
  • 10,263
  • 1
  • 20
  • 27
  • +1 from me, typically great NickW answer. Also, what a great project name; I have visions of an albino sysadmin with a giant black LART, which radiates an evil light whilst crooning a vile, but highly-informative, song. – MadHatter Apr 24 '14 at 11:12
  • The name cluebringer definitely strikes a nerve with many an email administrator :D – NickW Apr 24 '14 at 11:19
  • Thanks nick, As you suggested i haved installed the cluebringer. These are the settings of main.cf "smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:10031, permit mynetworks, reject_unauth_destination smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031 " – user103373 Apr 24 '14 at 11:36
  • Also, I have added a rule to send only 3 messages in 3600 secs. but still i am able to send more than 3 messages. Can you please help me to create the rules if i did something wrong!!! – user103373 Apr 24 '14 at 11:39
  • user103373, if you have supplementary questions it's best to edit them into your existing question (or even start a new question, referencing this one) not post them as a comment. Note also that it's polite to accept the answer that best helps you, by clicking on the tick outline next to it. That drives the SF reputation system both for you and the author of that answer; my apologies if you already knew that. – MadHatter Apr 24 '14 at 11:40
  • Yeah, we can probably help you to set up some rules, if you can do as MadHatter asked. – NickW Apr 24 '14 at 11:53
  • Hi guys can you help me to setup the rules. – user103373 Apr 24 '14 at 13:06