-
Notifications
You must be signed in to change notification settings - Fork 0
Using pflogsumm with Ubuntu 20.04
pflogsumm is a nice utility for getting concise hourly/daily mail statistics from postfix, It parses log files that are piped into it.
Unfortunately The mail.log files in Ubuntu 20.04 were a little different than they have been in the past. I had to make some permission modifications to allow pflogsumm to read them.
Permissions in Ubuntu 20.04 are set on log files at boot. Any permissions to log files in /var/log
that are modified with chown
will be overwritten at the next boot. To circumvent this:
Edit /usr/lib/tmpfiles.d/00rsyslog.conf
Set the permissions to something similar, a little less restrictive than the default.
z /var/log/mail.log 0644 syslog adm -
Now cat /var/log/mail.log | pflogsumm -d today | more
should output correctly and can be called by non root users and scripts.