From: Wietse Venema (no email)
Date: Sun Dec 01 2002 - 13:48:06 EST
Here's my own /etc/periodic/daily/460.status-mail-rejects script,
and yes it needs updating when logging formats change.
This script will not show rejected mail when the client never
returned after a soft (450) error code from the server. I use 450
for non-FQDN HELO hostnames, so that I can whitelist mis-configured
sites that aren't spammers.
Wietse
#!/bin/sh
#
echo ""; echo "Scanning maillog for rejections:"
zcat -fc /var/log/maillog.0* /var/log/maillog | egrep reject: | cut -d : -f 5- | sort | uniq -c | sort -nr | grep -v '^ *[1-2] *[^ ]* [^ ]* from [^ ]*: 450 '
echo ""; echo "Scanning maillog for warnings:"
zcat -fc /var/log/maillog.0* /var/log/maillog | egrep warning: | cut -d : -f 5- | sort | uniq -c
echo ""; echo "Scanning maillog for trouble:"
zcat -fc /var/log/maillog.0* /var/log/maillog | egrep '(fatal|panic):'
exit
|
|
|