How to Analysis Postfix Logs via Software Pflogsumm

Pflogsumm function:
Statistics of mails received, delivered, forwarded, delayed, bounced, rejected, retained, and discarded; Statistics of senders and recipients; Statistics of sending and receiving hosts/domain names; Count the number of SMTPD connections.
1. Installation
CentOS:  yum install postfix-pflogsumm -y
Ubuntu:  apt-get install pflogsumm -y
2. Use
# Email details are counted within 7 days:  pflogsumm  /var/log/maillog
# Count today's email messages:  pflogsumm -d today /var/log/maillog
# Count yesterday's email messages:  pflogsumm -d yesterday /var/log/maillog
# Count messages for specific dates:  pflogsumm "Apr 7" /var/log/maillog 
If the log content is too much, you can use the following command to filter out the summary content: 
pflogsumm -d today /var/log/maillog | grep -m 1 -A 18 "messages"
You can also use the following command to export to a file and then download the file to a local view:
pflogsumm -d today /var/log/maillog > maillog.txt

Add Feedback