[prev in list] [next in list] [prev in thread] [next in thread] 

List:       procmail
Subject:    Re: reading subjects into variables
From:       Philip Guenther <guenther () gac ! edu>
Date:       1996-11-22 0:41:30
[Download RAW message or body]

Guy Geens <ggeens@elis.rug.ac.be> writes:
>On Thu, 21 Nov 1996, James V. Di Toro III wrote:
>
>> :0
>> * Subject: [0-9]*
>> $HOME/folders/$MATCH
>> 
>You forgot the \/ to indicate where the match should start. Also, it's 
>better to use a lockfile, in case two mails get saved to the same folder. 
>So the recipe should be:
>
># There's a tab and a space between the first []
>:0:
>* ^Subject:[ 	]*\/[0-9]*
>$HOME/folders/$MATCH

...and this won't quite work either.  For a subject with a space after
the tab, the '*' on the lefthand side will be matched minimally (zero
times), and then the stuff on the righthand side will be matched
maximally, but starting at the space still, which will match nothing.

This is a case were procmail's minimal matching can cause massive
confusion and frustration.  The solution is usually the following:

	FORCE THE RIGHTHAND SIDE TO MATCH AT LEAST ONE CHARACTER

Change the above to:

:0:
* ^Subject:[ 	]*\/[0-9]+
$HOME/folders/$MATCH


and it'll work, because then the lefthand side will have to match all
the way up to the first digit (but not the digit itself).  If you
follow the rule in caps then you'll almost always be able to ignore
procmail's weirdness in this area.

Philip Guenther

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic