From owner-freebsd-bugs@FreeBSD.ORG Sat Oct 18 07:10:17 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B22616A4B3 for ; Sat, 18 Oct 2003 07:10:17 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2C7C43FBF for ; Sat, 18 Oct 2003 07:10:14 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h9IEAEFY076200 for ; Sat, 18 Oct 2003 07:10:14 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h9IEAEa9076199; Sat, 18 Oct 2003 07:10:14 -0700 (PDT) (envelope-from gnats) Resent-Date: Sat, 18 Oct 2003 07:10:14 -0700 (PDT) Resent-Message-Id: <200310181410.h9IEAEa9076199@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Matthew Seaman Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6737216A4B3 for ; Sat, 18 Oct 2003 07:04:20 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 863EF43FDD for ; Sat, 18 Oct 2003 07:04:17 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h9IE3cHR066447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 18 Oct 2003 15:04:08 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id h9IE3cO3066446; Sat, 18 Oct 2003 15:03:38 +0100 (BST) (envelope-from matthew) Message-Id: <200310181403.h9IE3cO3066446@happy-idiot-talk.infracaninophile.co.uk> Date: Sat, 18 Oct 2003 15:03:38 +0100 (BST) From: Matthew Seaman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/58206: [Patch] 460.status-mail-rejects incompatible with FEATURE(delay_checks) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Matthew Seaman List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2003 14:10:17 -0000 >Number: 58206 >Category: bin >Synopsis: [Patch] 460.status-mail-rejects incompatible with FEATURE(delay_checks) >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 18 07:10:14 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Matthew Seaman >Release: FreeBSD 4.9-RC i386 >Organization: Infracaninophile >Environment: System: FreeBSD happy-idiot-talk.infracaninophile.co.uk 4.9-RC FreeBSD 4.9-RC #34: Sat Oct 11 18:13:40 BST 2003 root@happy-idiot-talk.infracaninophile.co.uk:/usr/obj/usr/src/sys/HAPPY-IDIOT-TALK i386 >Description: Adding FEATURE(delay_checks) to the sendmail configuration to permit that more flexible style of anti-relaying, anti-spam checking has the unintended consequence that it makes the output of the daily periodic script 460.status-mail-rejects pretty much meaningless. Eg. I see this result with the unmodified script: Checking for rejected mail hosts: 35 infracaninophile.co.uk 1 happy-idiot-talk.infracaninophile.co.uk whereas I'd expect to see something more like this: Checking for rejected mail hosts: 4 [207.62.90.3] 4 200-221-148-37.internetturboadsl.speeduol.com.br 2 user-0ccehb8.cable.mindspring.com 2 node-c-77d2.a2000.nl 1 x1.namehistory.com 1 pcp05657719pcs.madsnh01.mi.comcast.net 1 pcp04168201pcs.macmb101.mi.comcast.net 1 hx2.netscapw.com 1 host31.27q.com 1 hnllhi1-ar7-4-7-215-134.hnllhi1.dsl-verizon.net 1 h68-144-35-115.cg.shawcable.net 1 fl-hob-u1-c6a-1-148.pbc.adelphia.net 1 evrtwa1-ar19-4-41-130-210.evrtwa1.dsl-verizon.net 1 d235-141-196.home1.cgocable.net 1 cr2006815553.cable.net.co 1 c-67-160-208-93.client.comcast.net 1 c-66-176-46-140.se.client2.attbi.com 1 adsl-61-66-59-205.KH.sparqnet.net 1 [64.245.209.18] 1 [218.7.144.189] 1 [208.48.233.31] 1 [168.126.72.243] 1 CL210-201-162-109.adsl.fx.apol.com.tw 1 66-108-56-164.nyc.rr.com 1 218-162-123-184.HINET-IP.hinet.net 1 200-161-4-30.dsl.telesp.net.br 1 200-161-21-14.dsl.telesp.net.br 1 180-210.leased.cust.tie.cl This ultimately comes down to 'delay_checks' causing all of the anti-spam checks to be run as part of the check_rcpt ruleset, rather than the more usual check_mail or check_relay rulesets. This results in maillog lines similar to these: Oct 18 09:45:54 happy-idiot-talk sm-mta[85697]: h9I8jsHQ085697: ruleset=check_rcpt, arg1=, relay=cpc1-bsfd2-6-0-cust122.cmbg.cable.ntl.com [81.96.158.122], reject=553 5.1.8 ... Domain of sender address mirande_nl@tunese.com does not exist Oct 18 09:46:26 happy-idiot-talk sm-mta[86389]: h9I8jtHQ086389: ruleset=check_rcpt, arg1=, relay=cpc1-bsfd2-6-0-cust122.cmbg.cable.ntl.com [81.96.158.122], reject=550 5.7.1 ... Mail from 81.96.158.122 rejected using spamcop.net DNSBL. See http://spamcop.net/w3m?action=checkblock&ip=81.96.158.122 Oct 18 11:11:49 happy-idiot-talk sm-mta[31464]: h9IAAIHQ031464: ruleset=check_rcpt, arg1=, relay=[207.62.90.3], reject=451 4.1.8 Domain of sender address slabrucherie@cuhsd.k12.ca.us does not resolve For check_rcpt the 'arg1' value is always the recipient address rather than the envelope sender address. In the case of the 'check_rcpt' rule it would be more worthwhile to print out the 'relay' value. >How-To-Repeat: On a machine that handles internet mail traffic, edit /etc/mail/`hostname`.mc and add: FEATURE(delay_checks)dnl Then rebuild the sendmail.cf and restart sendmail: # cd /etc/mail # make install # make restart-mta Leave system running for a few days and inspect daily periodic output. >Fix: --- 460.status-mail-rejects.diff begins here --- --- 460.status-mail-rejects.orig Sat Oct 18 14:30:41 2003 +++ 460.status-mail-rejects Sat Oct 18 14:35:17 2003 @@ -51,8 +51,8 @@ done cat /var/log/maillog } | - perl -ne "print \"\$2\n\" - if (/reject=/ and /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=/o);" | + perl -ne "print \$1 eq 'rcpt' ? \"\$4\n\" : \"\$3\n\" + if (/reject=/ and /^$start.*ruleset=check_(\S+),\s+arg1=(<[^@]+@)?([^>,]+).*relay=([^ ,]+)[ ,].*reject=/o);" | sort -f | uniq -ic | sort -fnr | tee /dev/stderr | wc -l) [ $rc -gt 0 ] && rc=1 fi;; --- 460.status-mail-rejects.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: