Statistics mail server by Pflogsumm - Postfix

Hey,
There is a script called pflogsumm ( http://jimsun.linxnet.com/postfix_contrib.html ) who is able to collect everyday Postfix’s statistics.
Those stats can be sent to a mail address, to keep an eye on what is doing your mail server.
I think It’s really useful and interesting, you can read it quickly if there’s a shit somewhere (soo many mails pending… waiting to deliver… relaying spam?.. etc.).

If I’m not wrong, only cron is needed to launch this perl script, to read a log generated by Postfix.
May be this feature can be added to every admin who want to receive everyday stats from the server ? And I think it will be easy to integrate it to Yunohost ?
I’ve got it running really fast on a RPi with ~50 mails/day

To see a report : 1st example found at random on the web : https://calomel.org/pflogsumm.html

Thx for reading :wink:
I hope it can be interesting!!

4 Likes

Can you give a brief detail on how you configured it?

Hey,
I got some notes about… I hope it’s working with current linux version…

apt-get install pflogsumm
(or it’s possible to wget the script from the website on my first message)

Everyday it will scan the mail server log + send a mail to a @mail address, just before 00:00
as root :
crontab -e
Then add this to your crontab :

# STATS MAIL SERVER pflogsumm
59 23 * * * /usr/sbin/pflogsumm -u 5 -h 5 -d today /var/log/mail.log | mail -s "Postfix Report of `date`" yourmail@domain.tld

(the “date” variable will write the current day to the mail title)

2 Likes

@petrus Thanks

I got no Yunohost for the moment near me,
so I hope it’s working for current Yunohost version (if everything is logged in the file /var/log/mail.log, it will be ok), and I’ll be glad if this little and quick tuto can help :wink:

@petrus Yes it works very well. Thanks for the tutorial.

Happy to read this :slight_smile:
I’ll try to set up a new server with Yunohost, and for sure I’ll try this!
So I think it can be a nice feature to add as an option for server owners :wink: This option will activate this script and add the cron task!

2 Likes

Finally decided to run it on my server. Thanks for the tip !

Yes, it’s fast and light on a personal server (running fine on a RPi 2), and useful for keeping an eye easilly on the mail server activity everyday :wink:

1 Like