#! /bin/bash

# search for header_checks rejections in mail.log and
# print only the rejected text.
#
# particularly useful when run like this:
#
# grep-header.sh | sort | uniq -c | sort -n | less

LOG="$1"

[ -z "$LOG" ] && LOG=/var/log/mail.log

grep -hi "reject: header " $LOG | \
	sed -e 's/.*reject: header \(.*\) from .*/\1/' 
