procmail
[Top] [All Lists]

Re: Servers That Strip X-Loop:

1997-08-06 09:17:00
On Wed, 6 Aug 1997, era eriksson wrote:

On Wed, 6 Aug 1997 10:30:01 -0400 (EDT),
Paul O Bartlett <pobart(_at_)access(_dot_)digex(_dot_)net> wrote:
 >     Has anyone come up with a method of dealing with this situation,
 > i.e., with ill-mannered list servers which do obnoxious things to mail
 > headers?  (One mail server stripped out MIME headers, which caused
 > unpleasantness on a non-English, non-USASCII list.)

Did ! ^FROM_MAILER not catch this?

    I admit that I did not think to put * ! ^FROM_MAILER in the
rejection recipe.  However, that macro is so complicated that I have
trouble unraveling it.  (My version of procmail is 3.10).  Here is an
actual header from a "normal" received post (before unsubscribing). 
(Some fields X'ed out for privacy.)  I am not sure whether FROM_MAILER
would catch this or not.  Also, I can (potentially) use this reject.rc
recipe for emails which come from individuals, not just mailing list
servers.  Indeed, that is what I originally wrote it for.  Presumably 
such personally-addressed incoming mails would not have X-Loop: with 
_my_ address in them unless somebody knew how to fake things out.

    The INCLUDERC'ed reject.rc:

:0
* ^Date: *\/[^ ].*
{ THEDATE=$MATCH }

:0
* ^Subject: *\/[^ ].*
{ THESUBJ=$MATCH }

:0
* ^From: *\/[^ ].*
{ WHOFROM=$MATCH }

# Get message size (recipe from David W. Tamkin)
:0HB   # Note trailing period in first condition line
* 1^1 .
* 1^1 ^.*$
* -1^0
{ }
THESIZE = $=

# Send rejection message
:0 c
* $ !^X-Loop: \$MY_ADDR
| (formail -rA"Precedence: junk"                 \
     -A"X-Loop: $MY_ADDR";                       \
   echo "Your mail arrived dated: $THEDATE";     \
   echo "and concerning Subject: $THESUBJ";      \
   echo "but has been refused by the recipient." \
  ) | $SENDMAIL -oi -t

# Turn on logging so we can record the action
VERBOSE=off
LOGABSTRACT=yes

# Log disposition; splitting "" across lines is deliberate
LOG="Rejected: $THEDATE $WHOFROM $THESUBJ $THESIZE
"

# Reset logging to what it normally is for our procmail
VERBOSE=$VERBOSITY
LOGABSTRACT=$LOGGING

# [I no longer remember why I put the condition in this one.]
# [Maybe it's a long-forgotten typo.  In any case, it was the
# [rejection message above with the X-Loop: missing upon 
# [reflection from the mailing list server that was causing
# [the endless loop.]
:0
* $ !^X-Loop: \$MY_ADDR
/dev/null

    A header from an actual message:

From xxxxxx(_at_)aol(_dot_)com Wed Aug  6 11:27:26 1997
Received: from beirut.leb.net (beirut.leb.net [206.127.55.2])
        by mail1.access.digex.net (8.8.5/8.8.5) with ESMTP id AAA05870;
        Tue, 5 Aug 1997 00:53:15 -0400 (EDT)
Received: (from majordomo(_at_)localhost)
        by beirut.leb.net (8.8.5/8.8.5) id EAA02265
        for xxxxxxxxxxxx-outgoing; Tue, 5 Aug 1997 04:52:32 GMT
Received: from emout06.mail.aol.com (emout06.mx.aol.com [198.81.11.97])
        by beirut.leb.net (8.8.5/8.8.5) with ESMTP id EAA02259
        for <xxxxxxxxxxxx(_at_)leb(_dot_)net>; Tue, 5 Aug 1997 04:52:28 GMT
From: xxxxxx(_at_)aol(_dot_)com
Received: (from root(_at_)localhost)
          by emout06.mail.aol.com (8.7.6/8.7.3/AOL-2.0.0)
          id DAA14300 for xxxxxxxxxxxx(_at_)leb(_dot_)net;
          Sun, 3 Aug 1997 03:27:30 -0400 (EDT)
Date: Sun, 3 Aug 1997 03:27:30 -0400 (EDT)
Message-ID: 
<970803032728_-121317739(_at_)emout06(_dot_)mail(_dot_)aol(_dot_)com>
To: xxxxxxxxxxxx(_at_)leb(_dot_)net
Subject: Re: xxxxxxxxxxxxxxxxxxxxxx
Sender: owner-xxxxxxxxxxxx(_at_)leb(_dot_)net
Precedence: bulk
Reply-To: xxxxxxxxxxxx <xxxxxxxxxxxx(_at_)leb(_dot_)net>

Paul                             <pobart(_at_)access(_dot_)digex(_dot_)net>
----------------------------------------------------------
Paul O. Bartlett, P.O. Box 857, Vienna, VA 22183-0857, USA
Finger, keyserver, or WWW for PGP 2.6.2 public key
Home Page:  http://www.access.digex.net/~pobart

<Prev in Thread] Current Thread [Next in Thread>