Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Oct 2003 15:03:38 +0100 (BST)
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/58206: [Patch] 460.status-mail-rejects incompatible with FEATURE(delay_checks)
Message-ID:  <200310181403.h9IE3cO3066446@happy-idiot-talk.infracaninophile.co.uk>
Resent-Message-ID: <200310181410.h9IEAEa9076199@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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=<m.seaman@infracaninophile.co.uk>, relay=cpc1-bsfd2-6-0-cust122.cmbg.cable.ntl.com [81.96.158.122], reject=553 5.1.8 <m.seaman@infracaninophile.co.uk>... 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=<m.seaman@infracaninophile.co.uk>, relay=cpc1-bsfd2-6-0-cust122.cmbg.cable.ntl.com [81.96.158.122], reject=550 5.7.1 <m.seaman@infracaninophile.co.uk>... 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=<m.seaman@infracaninophile.co.uk>, 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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310181403.h9IE3cO3066446>