procmail
[Top] [All Lists]

Re: digest and filtering out

2001-01-22 16:34:22
Dominic asked,

| I am receiving a digest which I split with the following rule

| :0:
| * ^Subject:.*The_Dojang-Digest
| | $FORMAIL +1 -ds | sed -e 's/the_dojang: //g' >> $TAEKWONDO

| However, with all digest received there is
| general disclaimer that gets deliver with the subject line:

| Subject: .

| I thus I would like that the delivery process in the folder
| $TAEKWONDO to exclude the message if the subject is ".".  

You have to call procmail recursively.  I've often felt that it would be nice
if procmail, like sed or perl, supported a -e option to put run-time code
onto the command line, but it doesn't, so you need an rcfile for the recipes
that procmail will use on the split-out individual messages.

I won't address the advisability of using variables for the program name (you
do for formail but not for sed) and the folder name, nor that of relying on
the subject alone to recognize the digests ... those are for another time.

The easiest way:

 :0
 * ^Subject:.*The_Dojang-Digest
 | sed 's/the_dojang: //g' | formail +1ds procmail -p .dojangrc

where $HOME/.dojangrc contains

 :0
 * ^Subject: \.$
 { HOST }

 DEFAULT=$TAEKWONDO

By using procmail's -p option, setting the value of $TAEKWANDO in the main
rcfile will be enough; you won't have to repeat the assignment in .dojangrc.

With proper loop detection you can put it all into the main rcfile instead,
but I think a separate rcfile is a better idea.

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