In Postfix, how do I measure how much traffic is used by each user or domain?
I can see no "out of the box" means of doing this with vanilla postfix, however, I am sure this is a pretty common need. So how do you solve it?
Bonus info would be to also measure dovecot traffic as well.
For Postfix logs, how about isoqlog? It's a bit dusty and old, but generates nice HTML summaries. If you want a command line tool,
pflogsumm
is excellent.I don't know about Dovecot statistics, I'm more familiar with Cyrus.
How much traffic is generated in what way ? Where ?
On the network, coming in, going out, being processed ?
You can parse the logs to determine how many messages are received, sent, etc - the well-known mailgraph webapp is good at that.
For actual message sizes per domain, you may be better off piping the postfix logs to a database, where they can be efficiently processed.