“This article describes how you can monitor your Postfix mailserver with the tools Mailgraph and pflogsumm. Mailgraph creates daily, weekly, monthly, and yearly graphs of sent, received, bounced, and rejected emails and also of spam and viruses, if SpamAssassin and ClamAV are integrated into Postfix. These graphs can be accessed with a browser, whereas pflogsumm (‘Postfix Log Entry Summarizer’) can be used to send reports of Postfix activity per email.”
There is a step in the instructions which involves copying the installed CGI script into your virtual hosts cgi-bin directory.
That is a bad idea, as it will prevent upgrades from happening – if the Debian package is upgraded the virtual host will still have the obsolete CGI script installed, and won’t be using the new one. As a quick fix I’d suggest making a symbolic link instead.
Alternatively updating your sites settings to create an alias, or setup the cgi-bin differently would be preferred.
Update whilst I remember the isoqlog program does a similar job and works with multiple mail servers. See this guide:
http://www.debian-administration.org/articles/230
Edited 2006-07-04 15:50
I haven’t messed with Mailgraph previously as I don’t have much use for stats viewable through a browser. I have been using pflogsumm for the past year or so on my NetBSD server and it’s pretty awesome. It’s also not necessary to write a script or mess with logrotate. I run it directly from a cron job and works great.
10 0 * * * /usr/pkg/sbin/pflogsumm -d yesterday /var/log/maillog 2>&1 |/usr/bin/mailx -s “`uname -n` daily mail stats” root