The $DEFAULT
at the end is a syntax error. You can't specify multiple actions on the same recipe.
What you can do is split it into two recipes; or, in this case, simply combine the rewriting and the delivery.
:0:
* ^TO_special@domain\.com
* ^Subject:\/.+
| /usr/local/bin/formail -I"Subject: [SPECIAL]$MATCH" >>$DEFAULT
This no longer has the fh
flags because we want to push the whole message through (not just the headers, which h
does) and we want to deliver, not capture the results of the pipeline back into Procmail (which f
does).
This assumes that $DEFAULT
is a file, not a directory; and thus we also add a second :
to specify locking.
If you wanted to specify two actions under a single set of conditions, you can use braces with multiple recipes inside them. Each recipe can have zero or more conditions but only one action.
:0
* ^TO_special@domain\.com
* ^Subject:\/.+
{
:0fhw
| formail -I"Subject: [SPECIAL]$MATCH"
:0:
$DEFAULT
}
but in this case that's an unnecessary complication.
(It would perhaps also be more idiomatic to move the ^Subject:
condition to the formail
recipe where it logically belongs, but this is just a tangent anyhow.)
Also tangentially, perhaps make sure your PATH
is correct right at the start of your .procmailrc
so you can avoid spelling out the full path to external utilities like formail
.