Re: save to list dir and conditionally to $DEFAULT

LuKreme <[email protected]>
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
Eric Smith squawked out on Monday 12-Nov-2012@01:05:14
> I want all list mail to be saved to the appropriate list folder
> and if they match a pattern in a file, also save to $DEFAULT.
> This is what I am trying, multiple stanzas like these;
> 
> 
> :0:
> * ^x-mailing-list:([^ ]*\/\<.*)
> {
> :0c
> $LISTDIR/`echo $MATCH|sed -e 's/[@\.>].*//g' -e 's/.*[ <]//' -e
> 's/.*://'`
> :0
> * ? egrep -if  /home/eric/serialised_subjects
> $DEFAULT
> }
> 
> :0:
> * ^x-list:([^ ]*\/\<.*)
> {
> :0c
> $LISTDIR/`echo $MATCH|sed -e 's/[@\.>].*//g' -e 's/.*[ <]//' -e
> 's/.*://'`
> :0
> * ? egrep -if  /home/eric/serialised_subjects
> $DEFAULT
> }
> 
> The behaviour without the `c' in :0c is that the mail is only saved in
> the list dir. And with the `c' in :0c, the mail is saved 
> MULTIPLE times in list dirs (as it matches more than one list
> regex condition) and one in the $DEFAULT.
> 
> What would be the correct implementation?

If your shell escape is producing multiple matches, then you probably should be doing that separately, and then checking the output.


-- 
Qui me amat, amat et canem meam
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.