procmail
[Top] [All Lists]

Re: ^FROM_MAILER

1998-04-29 15:24:31
ShadowCat <kitty(_at_)online(_dot_)pcd(_dot_)usr(_dot_)com> writes:
Does ^FROM_MAILER match on the
Return-Path:
line?  I looked at what the macro breaks down into and I didn't see any
occurance of it searching on the Return-Path line in the header. 
However, I have noticed that people who send me a message with
anything(_at_)domain(_dot_)name but with something like:
Return-Path: <Mailer-Daemon(_at_)domain(_dot_)name>
in the header that the ^FROM_MAILER sees it as a match.  Secondly, if
this is in fact the case does anyone have an idea how I can use this
macro but tell it to ignore the Return-Path line in the header?  I want
the matches on the From: line to be filtered correctly.

While the ^FROM_MAILER token doesn't match on Return-Path:, it does
match on the "From " line.  The address found in that line is generally
the same as that found in a Return-Path: header (namely, the envelope
sender).

As for keeping it from doing that, I can think of only one simple way
that really works: insert the token replacement text directly into your
.procmailrc, removing the unwanted part:

        :0
        * (^((Resent-)?(From|Sender)|X-Envelope-From):\
          ([^>]*[^((_dot_)%(_at_)a-z0-9])?(Post(ma(st(er)?|n)|office)\
          |(send)?Mail(er)?|daemon|mmdf|n?uucp|ops|r(esponse|oot)\
          |(bbs\.)?smtp(error)?|s(erv(ices?|er)|ystem)\
          |A(dmin(istrator)?|MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>     ]\
          [^<)]*(\(.*\).*)?)?$([^>]|$))         
        whatever


You can't just add a condition to see if the ^FROM_MAILER had matched
on the "From " line because it might have a possible later match on
another header line.


Philip Guenther

(As a footnote, SRB, the author of procmail, perfers to call the ^TO,
^TO_, ^FROM_MAILER, and ^FROM_DAEMON thingys, "tokens" instead of
"macros", probably because they only behave specially inside of
regexps, unlike a hypothetical macro which would also be expanded
inside variable assignments and other random places in one's
procmailrc.)

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