FreeBSD Bugzilla – Attachment 19736 Details for
Bug 35018
[patch] enhancing daily/460.status-mail-rejects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
460.status-mail-rejects.diff
460.status-mail-rejects.diff (text/plain; charset=us-ascii), 1.66 KB, created by
Morten Rodal
on 2002-08-10 21:07:25 UTC
(
hide
)
Description:
460.status-mail-rejects.diff
Filename:
MIME Type:
Creator:
Morten Rodal
Created:
2002-08-10 21:07:25 UTC
Size:
1.66 KB
patch
obsolete
>--- etc/periodic/daily/460.status-mail-rejects.orig Sat Aug 10 18:21:09 2002 >+++ etc/periodic/daily/460.status-mail-rejects Sat Aug 10 22:00:47 2002 >@@ -32,28 +32,39 @@ > echo > echo Checking for rejected mail hosts: > >- start=`date -v-1d '+%b %d' | sed 's/0\(.\)$/ \1/'` >- n=$(($daily_status_mail_rejects_logs - 2)) > rc=$({ >- while [ $n -ge 0 ] >+ for f in `find /var/log -name maillog\* \ >+ \( -mtime 1 -o -mtime 2 \) | xargs ls -tr` > do >- if [ -f /var/log/maillog.$n ] >- then >- cat /var/log/maillog.$n >- elif [ -f /var/log/maillog.$n.gz ] >- then >- zcat -fc /var/log/maillog.$n.gz >- elif [ -f /var/log/maillog.$n.bz2 ] >- then >- bzcat -fc /var/log/maillog.$n.bz2 >- fi >- n=$(($n - 1)) >+ case $f in >+ *.gz) zcat -fc $f;; >+ *.bz2) bzat -fc $f;; >+ *) cat $f;; >+ esac > done > cat /var/log/maillog >- } | >- perl -ne "print \"\$2\n\" >- if (/reject=/ and /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=/o);" | >- sort -f | uniq -ic | sort -fnr | tee /dev/stderr | wc -l) >+ } | awk ' >+ BEGIN { >+ today=systime(); >+ yesterday=strftime("%b %d", today-86400); >+ today=strftime("%b %d", today); >+ gsub(" 0", " ", today); gsub(" 0", " ", yesterday); >+ } >+ { >+ relay=gensub("^" yesterday ".*, relay=([^,]+), reject=.*", "\\1", 1); >+ if (relay != $0) >+ rejects[relay]++; >+ else if (match($0, "^" today)) >+ exit; >+ } >+ END { >+ for (relay in rejects) { >+ printf("%4d %s\n", rejects[relay], relay); >+ total += rejects[relay]; >+ } >+ if (total > 0) >+ printf("%4d TOTAL\n", total); >+ }' | sort -fnr | tee /dev/stderr | wc -l) > [ $rc -gt 0 ] && rc=1 > fi;; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 35018
:
19735
| 19736