For monitoring Postfix mail server we use the package known as Pflogsumm. It is written in perl programming language and it monitors Postfix mail server log files and its activities. This tutorial show how you will be configure the Pflogsumm and use it for its log monitoring purposes for postfix mail server. It is recommended to monitor your Postfix mail servers to protect against a external attacks and unwanted usages.
Step-1 (Check the mail log file first for monitoring purposes)
$ cat /var/log/mail.log
Step-2 (Install the Pflogsumm from default repositories)
$ sudo apt-get update && sudo apt-get install pflogsumm
Step-3 (After successfully installation done check the mail log files first)
$ pflogsumm /var/log/mail.log
After that you will see the huge amount of log information of postfix mail server using mail log files.
Step-4 (Setup CRON jobs to Schedule your Reports)
Finally Setup the Cron job to add a pflogsumm to a postfix mail server.
$ sudo vi /etc/cron.daily/pflogsumm
Add the given lines:
pflogsumm -d yesterday /var/log/mail.log | mail -s "Postfix log summaries" email@example.com
Note: You must replace the email firstname.lastname@example.org with your desired e-mail ID.
Step-5 (Finally Make the script executable using the chmod command)
$ sudo chmod u+x /etc/cron.daily/pflogsumm
Finally you have setup regular emails status with Postfix mail server using pflogsumm.
That’s all for now.