New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

Tips/Tricks - Daily mail server report

Started by iraqiboy90, March 05, 2022, 11:17:34 AM

Previous topic - Next topic

iraqiboy90

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/
cd /usr/local/sbin/
wget https://raw.githubusercontent.com/KTamas/pflogsumm/5184ce744d549b83e336ce1c1a899ad42138304e/pflogsumm.pl
chmod +x pflogsumm.pl


Install mailx
yum install mailx

Configure pflogsumm to send the daily report to your local email
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:
/usr/local/sbin/pflogsumm -d yesterday /var/log/maillog --problems_first --rej_add_from --verbose_msg_detail