From howardjp@byzantine.student.umd.edu  Thu Jun 29 13:01:12 2000
Return-Path: <howardjp@byzantine.student.umd.edu>
Received: from byzantine.student.umd.edu (byzantine.student.umd.edu [129.2.228.41])
	by hub.freebsd.org (Postfix) with ESMTP id 6E78537C16C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 29 Jun 2000 13:00:47 -0700 (PDT)
	(envelope-from howardjp@byzantine.student.umd.edu)
Received: (from howardjp@localhost)
	by byzantine.student.umd.edu (8.9.3/8.9.3) id QAA01615;
	Thu, 29 Jun 2000 16:00:45 -0400 (EDT)
	(envelope-from howardjp)
Message-Id: <200006292000.QAA01615@byzantine.student.umd.edu>
Date: Thu, 29 Jun 2000 16:00:45 -0400 (EDT)
From: howardjp@wam.umd.edu
Sender: howardjp@byzantine.student.umd.edu
Reply-To: howardjp@wam.umd.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] 'Nother bug in periodic scripts
X-Send-Pr-Version: 3.2

>Number:         19587
>Category:       conf
>Synopsis:       [PATCH] 'Nother bug in periodic scripts
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 29 13:10:01 PDT 2000
>Closed-Date:    Fri Jun 30 02:41:25 PDT 2000
>Last-Modified:  Fri Jun 30 02:41:57 PDT 2000
>Originator:     James Howard
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
University of Maryland
>Environment:

FreeBSD byzantine.student.umd.edu 5.0-CURRENT FreeBSD 5.0-CURRENT
#15: Sun Jun 18 21:23:23 EDT 2000
howardjp@byzantine.student.umd.edu:/usr/src/sys/compile/BYZANTINE  i386
 
>Description:

This may not be a bug, but the etc/periodic/daily/460.status-mail-rejects
only checks the two most recent log files for problems.  If someone has a
busy mail server and rotates the logs more often than once a day, they
will miss notifications.  Also (and this may seem like a non-issue), the
script is less portable this way.  The patch below should correct this.

>How-To-Repeat:

N/A

>Fix:

--- 460.status-mail-rejects.orig	Thu Jun 29 15:42:10 2000
+++ 460.status-mail-rejects	Thu Jun 29 15:42:42 2000
@@ -8,7 +8,7 @@
   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 | grep reject= |
+  zcat -fc /var/log/maillog.* /var/log/maillog | grep reject= |
 	perl -ne "print \"\$2\n\" 
 	if /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=/o;" |
 	sort | uniq -c | sort -nr

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Fri Jun 30 00:23:19 PDT 2000 
Responsible-Changed-Why:  
Over to the effective maintainer. ;-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19587 

From: Brian Somers <brian@Awfulhak.org>
To: howardjp@wam.umd.edu
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, brian@hak.lan.Awfulhak.org
Subject: Re: conf/19587: [PATCH] 'Nother bug in periodic scripts 
Date: Fri, 30 Jun 2000 09:22:53 +0100

 > >Number:         19587
 > >Category:       conf
 > >Synopsis:       [PATCH] 'Nother bug in periodic scripts
 [.....]
 > --- 460.status-mail-rejects.orig	Thu Jun 29 15:42:10 2000
 > +++ 460.status-mail-rejects	Thu Jun 29 15:42:42 2000
 > @@ -8,7 +8,7 @@
 >    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 | grep reject= |
 > +  zcat -fc /var/log/maillog.* /var/log/maillog | grep reject= |
 >  	perl -ne "print \"\$2\n\" 
 >  	if /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=/o;" |
 >  	sort | uniq -c | sort -nr
 
 Hi,
 
 I don't think this is the right answer to the problem.  Some people 
 may keep lots of old mail logs....
 
 I've added another variable - daily_status_mail_rejects_logs that 
 defaults to 3 (the previous code only did two files, leaving a window 
 of missed lines at the end of maillog.1* if the logs were rotated 
 after midnight and before 460.status-mail-rejects).
 
 Cheers.
 -- 
 Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
       <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
 Don't _EVER_ lose your sense of humour !
 
 
 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Fri Jun 30 02:41:25 PDT 2000 
State-Changed-Why:  
A slightly different patch has been applied. 
Thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19587 
>Unformatted:
