procmail
[Top] [All Lists]

Re: Recipy on "subject contains"

2004-05-28 07:11:37
On Fri, May 28, 2004 at 02:45:59PM +0200, Hans du Plooy wrote:
Hi all,

I'm trying to have procmail filter mail to a specific folder if the subject 
contains certain text, in this case [KT-USERS]

my recipy looks like this:
:0hb:
*^Subject:.[KT-USERS]
/home/hansdp/Maildir/.User-Lists.knowledgeTree/

The method works fine if I replace [KT-USERS] with ****SPAM**** to catch out 
mail tagged by spamassassin, but for some reason with [KT-USERS] it wouldn't 
work.  The log just tells me:

procmail: No match on "^Subject:.[KT-USERS]"

Does the brackets "[" or "]" interfere in some way?

[ and ] create a character class. What you're matching with:

  *^Subject:.[KT-USERS]

is subject lines that match any of the following:

  *^Subject:.K
  *^Subject:.T
  *^Subject:.U
  *^Subject:.S
  *^Subject:.E
  *^Subject:.R
  *^Subject:.S

You probably want to escape the [ and ]:

  *^Subject:.\[KT-USERS\]

Scott
-- 
Scott Wiersdorf
scott(_at_)perlcode(_dot_)org

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