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

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

Reduce (shrink) and resize raw disk at Proxmox

Apache 2.4 + mod_wsgi + Python 3.7 + Django installation on Centos 7.10