Collapse "fgrep | egrep | sed" down to a single sed.

This also trims extraneous commas from domain names.

MFC after:	7 days
This commit is contained in:
brian 2005-01-11 01:47:44 +00:00
parent 580248c6b5
commit db72d98ac1

View File

@ -51,9 +51,7 @@ case "$daily_status_mail_rejects_enable" in
done
cat /var/log/maillog
} |
fgrep 'reject=' |
egrep -e "^$start.*ruleset=check_[^[:space:]]+,[[:space:]]+arg1=(<[^@]+@)?([^>,]+).*reject=.*" |
sed -e 's/.*arg1=//' -e 's/.*@//' -e 's/[>[:space:]].*$//' |
sed -n -E "s/^$start"'.*ruleset=check_[^ ]+,[ ]+arg1=(<[^@]+@)?([^>,]+).*reject=.*/\2/p' |
sort -f | uniq -ic | sort -fnr | tee /dev/stderr | wc -l)
[ $rc -gt 0 ] && rc=1
fi;;