From owner-freebsd-bugs Wed Sep 27 13:10:27 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C01E937B43C for ; Wed, 27 Sep 2000 13:10:00 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id NAA90346; Wed, 27 Sep 2000 13:10:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (Postfix) with ESMTP id 1271D37B424 for ; Wed, 27 Sep 2000 13:08:40 -0700 (PDT) Received: (from smap@localhost) by whistle.com (8.10.0/8.10.0) id e8RK8dt19933 for ; Wed, 27 Sep 2000 13:08:39 -0700 (PDT) Received: from pau-amma.whistle.com( 207.76.205.64) by whistle.com via smap (V2.0) id xma019928; Wed, 27 Sep 2000 13:08:20 -0700 Received: (from dhw@localhost) by pau-amma.whistle.com (8.11.0/8.11.0) id e8RK8J815962; Wed, 27 Sep 2000 13:08:19 -0700 (PDT) (envelope-from dhw) Message-Id: <200009272008.e8RK8J815962@pau-amma.whistle.com> Date: Wed, 27 Sep 2000 13:08:19 -0700 (PDT) From: dhw@whistle.com Reply-To: dhw@whistle.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/21600: Case-insensitive sort/summary for mail rejects Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 21600 >Category: bin >Synopsis: /etc/periodic/daily/460.status-mail-rejects is case-sensitive >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Sep 27 13:10:00 PDT 2000 >Closed-Date: >Last-Modified: >Originator: David Wolfskill >Release: FreeBSD 4.1-STABLE i386 >Organization: Whistle Communications >Environment: /etc/periodic/daily/460.status-mail-rejects is at 1.8.2.2. >Description: 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 How-To-Repeat: Be the recipient of messages from spammers who use inconsistent capitalization in host names.... :-} >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 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 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 ,]+).*reject=/o);" | + perl -ne 'print lc($2) . "\n" + if (/reject=/ and /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=/o);' | sort | uniq -c | sort -nr fi;; esac (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 Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message