scripts/policyd-550.sh
2011-01-06 14:04:33 +01:00

11 lines
434 B
Bash
Executable file

#!/bin/bash
# $Id: policyd-550.sh 16 2009-04-28 12:51:28Z oli $
#
# Shows all mails rejected by policyd-weight.
# Requires that $REJECTMSG in /etc/policyd-weight.conf
# contains "550 Mail"
LOGFILE="/var/log/mail.log"
echo -e "Score\tRecipient\t\tSender"
grep -B1 '550 Mail' $LOGFILE | awk -F'<' '{print $4,$5}' | grep 'rate:' | sed -r -e 's/(to|from)=//g' -e 's/(>|;)//g' -e 's/rate: //g' | awk '{print $3"\t"$2"\t\t"$1}' | sort -n