Author Topic: Tips/Tricks - Daily mail server report  (Read 638 times)

0 Members and 1 Guest are viewing this topic.

Offline
**
Tips/Tricks - Daily mail server report
« on: March 05, 2022, 11:17:34 AM »
Hello

I think this could be very useful to keep a lookout on your mail server in order to keep track of possible spam attempt.
This service will email you a report after looking at the entire previous day's log and give you a short and detailed info on what got rejected, which email client sent emails and which email address sent email to your server.

You'll need:

- pflogsumm 1.1.3 (the service that give you the report)
- mailx (Optional: to send email from server to the server email administrator)

Download pflogsumm into /usr/local/sbin/
Code: [Select]
cd /usr/local/sbin/
wget https://raw.githubusercontent.com/KTamas/pflogsumm/5184ce744d549b83e336ce1c1a899ad42138304e/pflogsumm.pl
chmod +x pflogsumm.pl

Install mailx
Code: [Select]
yum install mailx
Configure pflogsumm to send the daily report to your local email
Code: [Select]
crontab -e
0 3 * * * /usr/local/sbin/pflogsumm -d yesterday /var/log/maillog --problems_first --rej_add_from --verbose_msg_detail | mail -s 'Postfix Report' yourEMAIL@address

You can test the command in SSH:
Code: [Select]
/usr/local/sbin/pflogsumm -d yesterday /var/log/maillog --problems_first --rej_add_from --verbose_msg_detail
« Last Edit: March 05, 2022, 11:20:43 AM by iraqiboy90 »