procmail
[Top] [All Lists]

Re: Help with match variable

2002-01-18 05:05:14
I'm trying to MATCH data from a field and then use it in the subject. I
have the following recipe:

:0 fc
* ^X-spamtrap: \/
| formail -I"Subject: Spamtrap ${MATCH}"

:0 A
! stspam(_at_)thaistuff(_dot_)com

This changes the subject to "Spamtrap" but doesn't pick up the \/ from the
X-spamtrap field. 

The MATCH variable contains the text that is matched by the regular
expression to the right of the '\/'.  Your regular expression stops at
the '\/' and so there's nothing more to put into the MATCH variable.
Presumably you're wanting what is on the rest of the 'X-spamtrap:' line,
in which case you want your condition to be something like:

  * ^X-spamtrap: \/.*

The '.*' will match the rest of the line, and that matched text will go
into the MATCH variable.

Hope that helps,
Martin
-- 
Martin McCarthy                 /</                  PGP key available
    `Procmail Companion'        \>\  http://www.ancient-scotland.co.uk
     Addison Wesley             /</    http://www.ehabitat.demon.co.uk
_______________________________________________
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>