procmail
[Top] [All Lists]

Re: subject mungeing and header question

1999-04-07 13:28:41
Chuck Campbell <campbell(_at_)neosoft(_dot_)com> writes:
I must be dense, here is the recipe I used to use, and now the one I tried w/
your suggestion above.

previous recipe:
:0:
* ^TOrennlist
porsche

New recipe:
:0 fhw
* ^TOrennlist
* ^Subject: *\[911\] \/.*
|formail -I"Subject: $MATCH"
porsche

with the new recipe, I get the following in my logfile:
...
procmail: Skipped "* ^Subject: *\[911\] \/.*"
procmail: Skipped "|formail -I"Subject: $MATCH""
procmail: Skipped "* ^Subject: *\[911\] \/.*"
procmail: Skipped "|formail -I"Subject: $MATCH""

Sometimes paraphrasing is a bad idea: the exact recipes you give above
could not generate those error message.


That last recipe, however, is almost certainly wrong.  A recipe has
only one action, so that procmail would parse it as:

start-recipe            :0
condition               * ^TOrennlist
condition               * ^Subject: *\[911\] \/.*
action                  |formail -I"Subject: $MATCH"
var-assign              porsche

Since it's not in the position of an action, the last line will be
treated as a variable assignment.  Since it lacks an equals sign,
procmail will simply unset the variable "porsche".

If you wanted to change the subject line and save the message to the
porsche file then you should write:


        :0 fhw
        * ^TOrennlist
        * ^Subject: *\[911\] \/.*
        |formail -I"Subject: $MATCH"

        :0 A:
        porsche

The first recipe will change the subject line.  If its conditions
match, then the second recipe will be processed and the message will be
saved to the "porsche" folder.


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>