1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00

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
This commit is contained in:
Diomidis Spinellis 2008-01-08 07:22:43 +00:00
parent 39033470fe
commit f029c53a5c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175153
2 changed files with 9 additions and 1 deletions

View File

@ -127,6 +127,7 @@ daily_status_security_enable="YES" # Security check
# 460.status-mail-rejects
daily_status_mail_rejects_enable="YES" # Check mail rejects
daily_status_mail_rejects_logs=3 # How many logs to check
daily_status_mail_rejects_shorten="NO" # Shorten output
# 470.status-named
daily_status_named_enable="YES"

View File

@ -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;;