2011-03-20 19:14:10 +01:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
#
|
|
|
|
|
# Made by Stefan B<>hler, Switzerland
|
|
|
|
|
# Monitor blocked Mails during Postfix RBL Scan, included Spamhaus, Spamcop, Manitu, MSRBL, NJABL
|
|
|
|
|
|
|
|
|
|
|
2018-08-03 13:00:34 +02:00
|
|
|
|
# Allow user to specify logfile through env.logfile
|
|
|
|
|
LOGFILE=${logfile:-/var/log/mail.log}
|
2011-03-20 19:14:10 +01:00
|
|
|
|
DATE=`date '+%b %e %H'`
|
|
|
|
|
MAXLABEL=20
|
|
|
|
|
|
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
2018-08-03 12:59:16 +02:00
|
|
|
|
if [ -r "$LOGFILE" ]; then
|
|
|
|
|
echo yes
|
|
|
|
|
else
|
|
|
|
|
echo "no (log file not found: $LOGFILE)"
|
|
|
|
|
fi
|
|
|
|
|
exit 0
|
2011-03-20 19:14:10 +01:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
2018-08-03 13:00:34 +02:00
|
|
|
|
echo 'graph_title RBL Counter'
|
|
|
|
|
echo 'graph_category mail'
|
|
|
|
|
echo 'graph_args --base 1000 -l 0'
|
|
|
|
|
echo 'graph_vlabel block during RBL'
|
|
|
|
|
echo 'spamhaus.label Blocked by Spamhaus.org'
|
|
|
|
|
echo 'spamcop.label Blocked by Spamcop'
|
|
|
|
|
echo 'manitu.label Blocked by manitu.net'
|
|
|
|
|
echo 'msrbl.label Blocked by msrbl.net'
|
|
|
|
|
echo 'njabl.label Blocked by njabl.org'
|
|
|
|
|
exit 0
|
2011-03-20 19:14:10 +01:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo -en "spamhaus.value "
|
|
|
|
|
echo $(grep "blocked using sbl-xbl.spamhaus.org" $LOGFILE | grep "$DATE" | wc -l)
|
|
|
|
|
echo -en "spamcop.value "
|
|
|
|
|
echo $(grep "blocked using bl.spamcop.net" $LOGFILE | grep "$DATE" | wc -l)
|
|
|
|
|
echo -en "manitu.value "
|
|
|
|
|
echo $(grep "blocked using ix.dnsbl.manitu.net" $LOGFILE | grep "$DATE" | wc -l)
|
|
|
|
|
echo -en "msrbl.value "
|
|
|
|
|
echo $(grep "blocked using combined.rbl.msrbl.net" $LOGFILE | grep "$DATE" | wc -l)
|
|
|
|
|
echo -en "njabl.value "
|
|
|
|
|
echo $(grep "blocked using combined.njabl.org" $LOGFILE | grep "$DATE" | wc -l)
|
|
|
|
|
|