procmail
[Top] [All Lists]

Re: MATCH operator and (!) not symbol

2007-12-15 13:20:20
PSE-L(_at_)mail(_dot_)professional(_dot_)org (Professional Software Engineering)
writes:

At 12:54 2007-12-15 -0600, reader(_at_)newsguy(_dot_)com wrote:
Can the match operator (\/) be used in a NOT recipe?

Example:
  :0
   * ! ^\/(To|Cc):.*(harryp|reader|bobbiep)@(reader|newsguy)\.

How can I capture lines that match that recipe?

Er, capture lines that DON'T match?  I don't get it.  Those are TWO
headers you're checking anyway, so which header do you want to catch
the non-match in?

I didn't follow your reply straight away (I mean the actual possible
recipes) it will take a while for me to get it through my thick skull.
I will be doing that shortly but just a comment here about your
apparent amazement in what I posted.

Consider for a moment what procmail logs themselves say about
match (wrapped for mail): 
   Match on \
      !"^\/(To|Cc):.*(harryp|reader|bobbiep)@(reader|newsguy)\."

Note it says that it matches that regex.  Doesn't get concerned about
1 or 2 headers or that its really a NOT style regex.  It simply says
that it Matches.

People speak of `\/' as match operators, so its not such a giant leap to
think it might hold whatever procmail says is a `Match'.

I did mention why I thought it wasn't working:

"procmail takes it at its word (the NOT regex) and doesn't assign the line
to $MATCH"

I appreciate the example recipes that will help me get at the
information I want going into MATCH and in the end .. a new header in
the message showing that information..... thanks  once again you've
suppled quick and usefull help.

FTR, you didn't include any example header lines from the message in
question, so how are we to evauate whether things appeared to run
correctly?

Too bad too since I had carefully edited them down and put into a text
file to include in that message but apparently got too carried away
with the other content and forgot it.. 

Including similar ones and corresponding verbose log output below:

=======================================================
Log output:

START
procmail: Executing "date,+%b %d %T %w "
procmail: Assigning "LOG=Dec 15 12:43:06 6
"
Dec 15 12:43:06 6
procmail: Assigning "TRAP=formail -XMessage-Id: && date +"%b %d %T%nSTOP""
procmail: Assigning "SCRIPTS=/home/reader/projects/perl"
procmail: Assigning "NotToMeRe=! 
^(MATCH_OPERATOR)(To|Cc):.*(harryp|reader|bobbiep)@(reader|newsguy)\."
procmail: Match on ! "^\/(To|Cc):.*(harryp|reader|bobbiep)@(reader|newsguy)\."
procmail: Match on ! "^(To|Cc):.*lydia-productions"
procmail: Executing "formail,-A,X-HPmatch: ,-A,HPrcp: ! 
^(MATCH_OPERATOR)(To|Cc):.*(harryp|reader|bobbiep)@(reader|newsguy)\."
procmail: Assigning "LASTFOLDER=NotToMe_spam.bk/106"
procmail: Opening "NotToMe_spam.bk/106"
procmail: Acquiring kernel-lock
From flip_jean(_at_)yahoo(_dot_)com  Wed Dec  5 12:00:02 2007
 Subject: aohs
  Folder: NotToMe_spam.bk/106                   4434
procmail: Assigning "EXITCODE=0"
procmail: Executing "formail -XMessage-Id: && date +"%b %d %T%nSTOP""
Message-ID: <578042131(_dot_)42981166582096(_at_)yahoo(_dot_)com>
Dec 15 12:43:06
STOP


===================================================
Edited Message headers:

From flip_jean(_at_)yahoo(_dot_)com  Wed Dec  5 12:00:02 2007
[...] snipped Return* and Receive*
Date:   Wed, 5 Dec 2007 18:41:20 +0100
From: "Dane Skinner" <flip_jean(_at_)yahoo(_dot_)com>
X-Mailer: The Bat! (v3.71.04) Professional
Message-ID: <578042131(_dot_)42981166582096(_at_)yahoo(_dot_)com>
To: rcon(_at_)newsguy(_dot_)com
Subject: aohs
MIME-Version: 1.0
[...] snipped another 20 or so lines
Content-Length: 2451
Lines: 48
X-HPmatch: 
HPrcp: ! ^(MATCH_OPERATOR)(To|Cc):.*(harryp|reader|bobbiep)@(reader|newsguy)\.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

[...]

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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