diff options
author | dds <dds@FreeBSD.org> | 2008-01-08 07:22:43 +0000 |
---|---|---|
committer | dds <dds@FreeBSD.org> | 2008-01-08 07:22:43 +0000 |
commit | 1484f849052138d405a5bf2d2bb8239d99a88a7b (patch) | |
tree | fa7d5a3ce2ca29f19731c65365b23c847fe4c2cf /etc/periodic | |
parent | c9a8a65b695565c6350befbe72685d8dcb81044f (diff) | |
download | FreeBSD-src-1484f849052138d405a5bf2d2bb8239d99a88a7b.zip FreeBSD-src-1484f849052138d405a5bf2d2bb8239d99a88a7b.tar.gz |
A new configuration variable, daily_status_mail_rejects_shorten, allows
the rejected mail reports to tally the rejects per blacklist without
providing details about individual sender hosts. The default configuration
keeps the reports in their original form.
MFC after: 1 week
Diffstat (limited to 'etc/periodic')
-rwxr-xr-x | etc/periodic/daily/460.status-mail-rejects | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/periodic/daily/460.status-mail-rejects b/etc/periodic/daily/460.status-mail-rejects index 2ff9601..4d40e20 100755 --- a/etc/periodic/daily/460.status-mail-rejects +++ b/etc/periodic/daily/460.status-mail-rejects @@ -11,6 +11,13 @@ then source_periodic_confs fi +case "$daily_status_mail_rejects_shorten" in +[Yy][Ee][Ss]) + sed_output='\4 \3...';; +*) + sed_output='\2 (\3... \4)';; +esac + case "$daily_status_mail_rejects_enable" in [Yy][Ee][Ss]) if [ ! -d /etc/mail ] @@ -51,7 +58,7 @@ case "$daily_status_mail_rejects_enable" in done cat /var/log/maillog } | - sed -n -E "s/^$start"'.*ruleset=check_[^ ]+, +arg1=<?([^@]+@)?([^>,]+).*reject=([^ ]+) .* ([^ ]+)$/\2 (\3... \4)/p' | + sed -n -E "s/^$start"'.*ruleset=check_[^ ]+, +arg1=<?([^@]+@)?([^>,]+).*reject=([^ ]+) .* ([^ ]+)$/'"$sed_output"'/p' | sort -f | uniq -ic | sort -fnr | tee /dev/stderr | wc -l) [ $rc -gt 0 ] && rc=1 fi;; |