diff --git a/etc/defaults/periodic.conf b/etc/defaults/periodic.conf index 81aecbc8af5..3d04a7fc85d 100644 --- a/etc/defaults/periodic.conf +++ b/etc/defaults/periodic.conf @@ -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 diff --git a/etc/periodic/daily/460.status-mail-rejects b/etc/periodic/daily/460.status-mail-rejects index 43bdf7dad7a..cfe42131e47 100755 --- a/etc/periodic/daily/460.status-mail-rejects +++ b/etc/periodic/daily/460.status-mail-rejects @@ -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 diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 1db6590e5d1..3ad5dc3d16b 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -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.