procmail
[Top] [All Lists]

Re: MATCH

2001-10-18 22:06:00
On Thu, 18 Oct 2001, Andrew Edelstein wrote:

Note that, tough there are the macros ^TO and ^TO_, there is is no ^FROM.

I suspect the regexp you have here isn't going to do what you think you want.

True, but "^FROM.*" still matches "^From:.*", but it matches more
than that.  Thanks for this, as I missed that.


If the messges headers have
      Subject: pmtest
OR
      Subject: cybr
OR
      From: deliberatus(_at_)my995internet(_dot_)com

Then your condition would be

* 
^(Subject:.*(pmtest|cybr)|From:(_dot_)*deliberatus(_at_)my995internet\(_dot_)com)


This was my intent, and I have rewritten my recipe to this format
(it is actually about 40 tests of subject, from and to conditions).

(variation 1)
* 
^(Subject.*\/(pmtest|cybr)|From:.*\/deliberatus(_at_)my995internet\(_dot_)com)

Actually, it was:
* ^\/(Subject.*(   ...etc

I thought I had tried it this way, but perhaps my erroneous regex
caused problems with it.  $MATCH was empty when I tried to use it.


Also, the above do not guaruntee $MATCH will be EXACTLY "pmtest" or "cybr" or
"deliberatus(_at_)my995internet(_dot_)com". Anything else following those 
strings within

I was aware of this.  This is not a problem, as I was only inserting
$MATCH into another header field prior to delivery to the
mailbox.  For some reason (probably due to the badly written regex),
this recipe trapped WAY more than it should have in one day's
mail.  It was sending the messages to /dev/null, so I am not sure
what was trapped.  I have now changed my strategy, and I am
delivering the mail to a "spam" folder and setting an extra header
called X-match with the value of $MATCH, so I will be able to tell
why it matched in the future.

With that said, I have it working with the help of the 3 or 4 of you
that sent me advise.  Thanks to all of you for your assistance.


-- 
Butch Evans
http://www.ChristInVerse.com/
http://www.HeIsComingSoon.com/ (in the works)

_______________________________________________
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>