From root@gina.neland.dk  Tue Mar 14 15:17:28 2000
Return-Path: <root@gina.neland.dk>
Received: from gina.neland.dk (38.ppp1-31.worldonline.dk [212.54.93.38])
	by hub.freebsd.org (Postfix) with ESMTP id 6873537B82E
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 14 Mar 2000 15:17:19 -0800 (PST)
	(envelope-from root@gina.neland.dk)
Received: (from root@localhost)
	by gina.neland.dk (8.9.3/8.9.3) id AAA00731;
	Wed, 15 Mar 2000 00:17:12 +0100 (CET)
	(envelope-from root)
Message-Id: <200003142317.AAA00731@gina.neland.dk>
Date: Wed, 15 Mar 2000 00:17:12 +0100 (CET)
From: leif@neland.dk
Sender: root@gina.neland.dk
Reply-To: leif@neland.dk
To: FreeBSD-gnats-submit@freebsd.org
Subject: "Checking for rejected mail hosts:" gives too little info <Synopsis of the problem (one line)>
X-Send-Pr-Version: 3.2

>Number:         17377
>Category:       conf
>Synopsis:       [periodic script] "Checking for rejected mail hosts:" gives too little info
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 14 15:20:02 PST 2000
>Closed-Date:    Mon Jan 24 14:46:53 GMT 2005
>Last-Modified:  Mon Jan 24 14:46:53 GMT 2005
>Originator:     Leif Neland
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:

	

>Description:

	The script /etc/periodic/daily/460.status-mail-rejects
	only shows which hosts are rejected, to see why one has
	to scan the log anyway.

	

>How-To-Repeat:

	
	Read the dayly reports sent by mail ;-)

>Fix:

*** /etc/periodic/daily/460.status-mail-rejects	Wed Sep 29 06:19:05 1999
--- ./460.status-mail-rejects	Wed Mar 15 00:04:57 2000
***************
*** 9,15 ****
  
    start=`date -v-1d '+%b %d' | sed 's/0\(.\)$/ \1/'`
    zcat -fc /var/log/maillog.0* /var/log/maillog | grep reject= |
! 	perl -ne "print \"\$2\n\" 
! 	if /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=/o;" |
  	sort | uniq -c | sort -nr
  fi
--- 9,15 ----
  
    start=`date -v-1d '+%b %d' | sed 's/0\(.\)$/ \1/'`
    zcat -fc /var/log/maillog.0* /var/log/maillog | grep reject= |
! 	perl -ne "print \"\$1 \$2 \$3\n\" 
! 	if /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=.*( .*$)/o;" |
  	sort | uniq -c | sort -nr
  fi

	

This gives the following report:
  54 <mlmopps@ public.com  resolve 
  21 <jnmk@ jnmklj.net  exist 
   9  c126.h202052094.is.net.tw  http://mail-abuse.org/rss 
   4 <bcg@ hp020  exist 
   4  05-021.006.popsite.net  http://mail-abuse.org/dul/enduser.htm 
   2 <ping@ dk.net  denied 

The last word of the line in the log is enough to identify the reason; the
username helps identifying the sender, if the customer calls the
supportline.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: asmodai 
Responsible-Changed-When: Mon Mar 27 06:52:35 PST 2000 
Responsible-Changed-Why:  
Belongs to bugs. 
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: johan 
Responsible-Changed-When: Mon Aug 19 09:56:08 PDT 2002 
Responsible-Changed-Why:  
Brian, as something of a periodic guru, what do you 
think of the proposed patch? 

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

From: Brian Somers <brian@Awfulhak.org>
To: leif@neland.dk
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: conf/17377: "Checking for rejected mail hosts:" gives too
 little info <Synopsis of the problem (one line)>
Date: Mon, 10 Jan 2005 13:05:50 +0000

 Hi,
 
 Any chance of generating a new patch for this change?  If you could, I'll
 test it here and commit.
 
 Thanks.
 
 -- 
 Brian Somers                                          <brian@Awfulhak.org>
 Don't _EVER_ lose your sense of humour !               <brian@FreeBSD.org>
State-Changed-From-To: open->feedback 
State-Changed-By: brian 
State-Changed-When: Mon Jan 10 13:14:30 GMT 2005 
State-Changed-Why:  
Awaiting feedback... 

http://www.freebsd.org/cgi/query-pr.cgi?pr=17377 
State-Changed-From-To: feedback->patched 
State-Changed-By: brian 
State-Changed-When: Tue Jan 11 02:17:02 GMT 2005 
State-Changed-Why:  
A fix has been committed to -current and will be MFC'd in 7 days if there are 
no complaints. 

Unfortunately, I had to rewrite the patch as the script has been changed to 
use sed rather than perl (as perl is no longer in the base system).  The 
originator should check the fix to see the changes that I sneaked in!! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=17377 
State-Changed-From-To: patched->closed 
State-Changed-By: brian 
State-Changed-When: Mon Jan 24 14:46:27 GMT 2005 
State-Changed-Why:  
I've MFC'd all of the recent changes to this script 

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