Add $daily_status_mail_rejects_logs, defaulting to 3 to control

how many /var/log/maillog* files to check

PR:	19587
This commit is contained in:
Brian Somers 2000-06-30 09:41:16 +00:00
parent 7c26f8927b
commit 2d60050a94
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62274
3 changed files with 23 additions and 2 deletions

View File

@ -104,6 +104,7 @@ daily_status_security_nomfs="NO" # Don't check mfs mounts
# 460.status-mail-rejects
daily_status_mail_rejects_enable="YES" # Check mail rejects
daily_status_mail_rejects_logs=3 # How many logs to check
# 999.local
daily_local="/etc/daily.local" # Local scripts

View File

@ -13,13 +13,22 @@ fi
case "$daily_status_mail_rejects_enable" in
[Yy][Ee][Ss])
if [ -d /etc/mail -a -f /var/log/maillog ]
if [ -d /etc/mail -a -f /var/log/maillog -a \
"$daily_status_mail_rejects_logs" -gt 0 ]
then
echo
echo Checking for rejected mail hosts:
start=`date -v-1d '+%b %d' | sed 's/0\(.\)$/ \1/'`
zcat -fc /var/log/maillog.0* /var/log/maillog |
n=$(($daily_status_mail_rejects_logs - 2))
{
while [ $n -ge 0 ]
do
[ -f /var/log/maillog.$n* ] && zcat -fc /var/log/maillog.$n*
n=$(($n - 1))
done
cat /var/log/maillog
} |
perl -ne "print \"\$2\n\"
if (/reject=/ and /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=/o);" |
sort | uniq -c | sort -nr

View File

@ -299,6 +299,9 @@ mounts when comparing against yesterdays filesystem mounts.
if you want to summarise mail rejections logged to
.Pa /var/log/maillog
for the previous day.
.It Ar daily_status_mail_rejects_logs
(num) Set to the number of maillog files that should be checked for yesterdays
mail rejects.
.It Ar daily_local
(str) Set to a list of extra scripts that should be run after all other
daily scripts.
@ -364,12 +367,20 @@ An orphaned file is one with an invalid owner or group.
(str) A list of directories under which orphaned files are searched for.
This would usually be set to
.Pa / .
<<<<<<< periodic.conf.5
.It Ar weekly_status_pkg_dirs
(bool) Set to
.Dq YES
if you want to report out-of-date packages installed using
.Xr pkg_version 1 .
=======
.It Ar weekly_status_pkg_dirs
(bool) Set to
.Dq YES
if you want to use
.Xr pkg_version 1
to list installed packages which are out of date.
>>>>>>> 1.4
.It Ar weekly_local
(str) Set to a list of extra scripts that should be run after all other
weekly scripts.