procmail
[Top] [All Lists]

Re: Match X but not Y if is also there

2001-11-30 21:01:27
*sigh*  Well I feel dumb.  I wasn't even thinking of something as simple
as that.  Here's what I'm using now.

#  --  broadwing.net
:0c
* ? formail -x"Received:" | egrep -is "broadwing.net"
* ! ^X-Loop: $ABUSE
* ! ? formail -x"Received:" | egrep -is "netzero.net"
{
        :0f
        | formail -I"X-Spam: broadwing.net" \
        -I"X-Loop: $ABUSE"

        :0:
        /var/spool/mail/quarantine/spam/broadwing.net
}
#  --  broadwing.net


I believe that's working.  I don't have a way to test that at the moment
though.  Ironically I'm having a closely related problem trying to match
my X-Loop header.  The initial spam arrives like normal and gets filtered
fine.  The X-Spam and X-Loop headers get added like expected.  Then I
bounce that message to my local non-prived user.  It shouldn't match it
because I told it to not match lines with "^X-Loop: $ABUSE" and yet it
matches it, delivers the message to my non-prived, and clones the message
and sticks the clonse in my spam box.  I have verbose logging around my
match on the almost identical recipe for advertising.com (same recipe that
just matches body not headers).  Here's the log entry for that.

procmail: Match on "advertising.com"
procmail: Match on ! "^X-Loop: abuse(_at_)sktc(_dot_)net"
procmail: Forking "procmail"
procmail: Assigning "VERBOSE=no"
procmail: [21199] Fri Nov 30 20:43:20 2001
procmail: Executing "formail,-I,X-Spam: advertising.com,-IX-Loop:
abuse(_at_)sktc(_dot_)net"
procmail: [21199] Fri Nov 30 20:43:20 2001
procmail: Locking "/var/spool/mail/quarantine/spam/advertising.com.lock"
procmail: Assigning
"LASTFOLDER=/var/spool/mail/quarantine/spam/advertising.com"
procmail: Opening "/var/spool/mail/quarantine/spam/advertising.com"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/spool/mail/quarantine/spam/advertising.com.lock"
From nobody(_at_)newfunpages(_dot_)com  Fri Nov 30 20:43:20 2001
 Subject: See what wildhorses_34(_at_)hotmail(_dot_)com sent you!!
  Folder: /var/spool/mail/quarantine/spam/advertising.com
1448
procmail: Notified comsat:
"simonsez(_at_)1010597:/var/spool/mail/quarantine/spam/advertising.com"
p


It matches my spam search string and then matched my X-Loop header.  I
don't get why.  I suppose I shoudl ask the question, the syntax you used
below and I used above are logical ANDs, aren't they?  Meaning it must
match broadwing.net but not match netzero.net?  If not then my problem
would be logic.  I'm confused I think.  Am I missing something easy again?

Thanks
 Justin





On Fri, 30 Nov 2001, Fred Morris wrote:

Is there a way to match broadwing.net in the Received line but not if
one also contains the strign netzero.net?

Perhaps something like this?

  :0 h
  * broadwing.net
  * !netzero.net

HTH

--

Fred Morris
m3047(_at_)inwa(_dot_)net




_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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