In Postfix, how do I measure how much traffic is used by each user or domain?

Solution 1:

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.

Solution 2:

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.