procmail
[Top] [All Lists]

Re: string on separate lines match

1999-04-06 12:30:58
Zhiliang Hu <hu(_at_)genome(_dot_)ansci(_dot_)iastate(_dot_)edu> writes:
I want to file mails addressed to "smartlist" separately, for example:

-----
:0
* ^(To|Cc):.*(S|s)mart(L|l)ist
Smartlist.mail

Regexps are case-insensitive by default in procmail, so you don't need
the "(S|s)".  Also, you may want to use the ^TO_ token as a shorthand for
matching against the different recipient headers:

        :0
        * ^TO_smartlist@

(^TO_ also eliminates the need for the ".*" before the address.)


However with the following mail header, when the string is not in the
same line as "To" and "Cc", the procmail recipe doesn't catch what it
supposed to:

To: Person One <one(_at_)someaddress(_dot_)org>
Cc: Person Two <two(_at_)earth(_dot_)sun(_dot_)com>,
   three(_at_)haha-net(_dot_)org,
   smartlist(_at_)informatik(_dot_)rwth-aachen(_dot_)de

Procmail internally converts the newline of a header continuation into
a space when matching against it, so the condition you included above,
or the version I gave, should both match against that header.  Did you
try this and it didn't work?  If so, what does the log show when you
put:
        VERBOSE=on

at the top of the rcfile involved?


Philip Guenther

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