procmail
[Top] [All Lists]

Re: Over zealous subject filter

2001-06-23 15:14:52
:0:
* ^SUBJECT(.*"Small Business Tip of the Day"*|\
        .*"Ask A Lawyer"*|\
        .*lawyer*|\
        .*"Business Tip"*|\
        .*workz*|\
        .*"Small Business Tip"*)
$HOME/Mail/posts/business
...
I've read all the man pages for procmail, including the recipe examples,
and haven't had much luck.  Certainly, I haven't come across anything
suggesting that "z" is a wildcard!

'.' is a wildcard.  '*' isn't.

'*' says "match zero or more of the previous character".  So "workz*"
matches 'w' 'o' 'r' 'k' 'zero or more zs'

You seem to half realise this as you use '.*' (to match zero or more of
any character) half the time and just '*' the other half of the time.
To do what you want you need to replace those trailing '*'s with '.*'.

However, you don't really need those trailing wildcards at all.  Just:
 
  :0:
  * ^SUBJECT(.*"Small Business Tip of the Day"|\
         .*"Ask A Lawyer"|\
         .*lawyer|\
         .*"Business Tip"|\
         .*workz|\
         .*"Small Business Tip")
 $HOME/Mail/posts/business

Take another look at the manpages with that in mind.
I suspect that you really want a recipe such as:

  :0:
  * ^Subject:.*(business tip|lawyer|workz)
  $HOME/Mail/posts/business

since they would match much the same things as your recipe - unless
you really want to match mails with those quotes in the subject.

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>