procmail
[Top] [All Lists]

Re: Matching literal square brackets from variable in procmail recipe

2010-03-12 08:46:07
At 12:17 2010-03-12 +0100, Emil Micek wrote:

[snip]
#decode subject
SUBJECT=`formail -xSubject: | $HOME/bin/decode_header`
LOG="SUBJECT: $SUBJECT
"

# mythtv-cz mailing list
:0:
* SUBJECT ?? \[mythtv-cz\]
mythtv-cz/

Leading backslashes on the regexp create something of an ambiguity. Preceed them with an empty pair of parens, and the problem goes away:

* SUBJECT ?? ()\[mythtv-cz\]


See "Literal Strings" in Era's Procmail Quick Reference Guide.

         <http://partmaps.org/era/procmail/quickref.html>


or 6.9 in the Procmail Tips:

<http://pm-doc.sourceforge.net/pm-tips.html#beware_leading_backslash>




Alternatley, you could use my listid.rc recipe (follow links in my .sig), which uses variour RFC-specified headers to identify lists (you could even run it and just log the results)

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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