Bug 17377 - [periodic script] "Checking for rejected mail hosts:" gives too little info
Summary: [periodic script] "Checking for rejected mail hosts:" gives too little info
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 5.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Brian Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-03-14 23:20 UTC by leif
Modified: 2005-01-24 14:46 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description leif 2000-03-14 23:20:02 UTC
	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.

Fix: 

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.--CrTsUSaZPCrppUbMKMNFaUQJAj8ENHoTe4qfNtJq46kRfi3b
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

*** /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
How-To-Repeat: 
	
	Read the dayly reports sent by mail ;-)
Comment 1 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-03-27 15:52:35 UTC
Responsible Changed
From-To: gnats-admin->freebsd-bugs

Belongs to bugs. 
Comment 2 Johan Karlsson freebsd_committer freebsd_triage 2002-08-19 17:56:08 UTC
Responsible Changed
From-To: freebsd-bugs->brian

Brian, as something of a periodic guru, what do you 
think of the proposed patch?
Comment 3 Brian Somers 2005-01-10 13:05:50 UTC
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>
Comment 4 Brian Somers freebsd_committer freebsd_triage 2005-01-10 13:14:30 UTC
State Changed
From-To: open->feedback

Awaiting feedback...
Comment 5 Brian Somers freebsd_committer freebsd_triage 2005-01-11 02:17:02 UTC
State Changed
From-To: feedback->patched

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!!
Comment 6 Brian Somers freebsd_committer freebsd_triage 2005-01-24 14:46:27 UTC
State Changed
From-To: patched->closed

I've MFC'd all of the recent changes to this script