Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to know if it's possible to count the outgoing (relayed) messages on a per user basis in postfix.

I'm managing a small commercial SMTP relay and decided that it would be nice to have a detailed daily report on how much mail a single user have sent (and eventually enforce some limits) possibly in realtime.

I've looked almost everywhere and started to think that writing my own milter would be the way to go...

Are you aware of anything that already exists for postfix that can count and report relayed mail for authenticated users (a script, milter or whatever)?

share|improve this question
possible duplicate of Limit number of outgoing messages in postfix – mailq Nov 23 '12 at 20:28
Well it's not exactly a duplicate of that question, but indeed the answer solves my problem too! Thanks mailq – Martino Dino Nov 24 '12 at 10:13
up vote 1 down vote accepted

Thanks to mailq I found the solution, as womble pointed out on the previous question, policyd is the answer. From the 2.1x version (unstable branch) there is an accounting module which can enforce limits.

share|improve this answer

You can easily limit number of outgoing messages from particular user (domain or group) with MSH Traffic Policy.

Application currently (version 0.2) does not have reporting module which you need, but if you write to the author there is a big chance that it will be implemented soon.

share|improve this answer
The license is not clear on the website :/ It looks like it's a commercial software, and it doesn't have the "accounting feature". – Martino Dino Nov 24 '12 at 10:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.