Daily mail statictics from postfix and pflogsumm via cron

On Centos

  yum install postfix-perl-scripts

create new script file

mcedit /etc/cron.daily/pflogsumm.sh

#!/bin/sh

# Mail Statistics
MAIL_LOG=/var/log/maillog
MAILHOST="YOUR.HOSTNAME.COM"
RECIPIENT="[email protected]"

# Generate the statistics and mail the result to $RECIPIENT
/usr/sbin/pflogsumm -d yesterday ${MAIL_LOG} | \
mail -s "${MAILHOST} Mail Statistics" ${RECIPIENT}



chmod +x /etc/cron.daily/pflogsumm.sh

Enjoy!
 

Comments

Popular posts from this blog

Securing the Pi-hole with fail2ban to prevent DNS Amplification attacks

How to clean DB from old logs in Magento 1.x

Python pxssh failed on login. could not set shell prompt