Bug 21600

Summary: /etc/periodic/daily/460.status-mail-rejects is case-sensitive
Product: Base System Reporter: David Wolfskill <dhw>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description David Wolfskill 2000-09-27 21:10:00 UTC
	Host names are case-insensitive (as far as DNS is concerned,
	at least).  It is thus a bit counter-intuitive to have the
	output (under "Checking for rejected mail hosts:") in the "daily
	run output" show such things as:

	Checking for rejected mail hosts:
	 156 interjetnet.net
	  63 whistle.com
	  13 INTERJETNET.NET
	   7 interjetnet.com
	   3 [203.69.38.37]
	   3 WHISTLE.COM
	   2 INTERJETNET.COM
	   1 mail.com
	   1 InterJetNet.net
	   1 <dts1.domedia.com.tw

	when the "interjetnet.net" and "INTERJETNET.NET" entries refer
	to effectively the same (broken) destination.

Fix: Well, I'd suggest the following, which takes care of the
	immediate problem:

===================================================================
RCS file: RCS/460.status-mail-rejects,v
retrieving revision 1.1
It does not nesessarily ensure any sort of consistency in the
	output, though -- before:

	Checking for rejected mail hosts:
	 156 interjetnet.net
	  63 whistle.com
	  13 INTERJETNET.NET
	   7 interjetnet.com
	   3 [203.69.38.37]
	   3 WHISTLE.COM
	   2 INTERJETNET.COM
	   1 mail.com
	   1 InterJetNet.net
	   1 <dts1.domedia.com.tw

	and after:

	Checking for rejected mail hosts:
	 170 INTERJETNET.NET
	  66 WHISTLE.COM
	   9 INTERJETNET.COM
	   3 [203.69.38.37]
	   1 mail.com
	   1 <dts1.domedia.com.tw

	
	So it's a bit of a hack, but it makes life a little easier on a
	postmaster....  :-}  Another alternative would be to hack the Perl
	part to lowercase the hostnames that are emitted:

===================================================================
RCS file: RCS/460.status-mail-rejects,v
retrieving revision 1.1


(So, a bit of time elapsed while I got the quoting right, which
	is why the numbers differ.)  Here's a result from this version:

	Checking for rejected mail hosts:
	 268 interjetnet.net
	 111 whistle.com
	  16 interjetnet.com
	   8 sginet.com
	   6 www.bhes.wash.k12.ut.us.
	   6 www.bhes.wash.k12.ut.us
	   5 [203.69.38.37]
	   1 www.bhes.wash.k12.ut.us.com
	   1 whispersintimates.cominfo@whistle.com
	   1 mail.com
	   1 <dts1.domedia.com.tw

	(That trailing dot is a bit annoying... but I'm running low on
	time to fix it....)--7OZ1Mqob25wA04sm977fPD6TqNXCWKzdTs5nRFHRcVmd3BjI
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -u -r1.1 460.status-mail-rejects
--- 460.status-mail-rejects	2000/09/27 19:17:41	1.1
+++ 460.status-mail-rejects	2000/09/27 19:18:58
@@ -37,6 +37,6 @@
 	    } |
 		perl -ne "print \"\$2\n\"
 		    if (/reject=/ and /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=/o);" |
-		sort | uniq -c | sort -nr
+		sort -f | uniq -ic | sort -fnr
 	fi;;
 esac
How-To-Repeat: 
	Be the recipient of messages from spammers who use inconsistent
	capitalization in host names....  :-}
Comment 1 Brian Somers freebsd_committer freebsd_triage 2000-10-02 22:54:44 UTC
State Changed
From-To: open->closed

Committed to -current - thanks. 
I'll MFC in a week