The braces around the action are a syntax error.
:0 # is the address spelled correctly? not don_T_forward?
* !^From:.*\<donforward@domain\.com\>
! other@recipient.net
(Or, alternatively but superfluously,
:0
* !^From:.*\<donforward@domain\.com\>
{
:0
! other@recipient.net
}
Also, see below.)
However, this can never actually match, because you change the From:
address in the previous recipe. Maybe add some logic to preserve the original From:
, or combine the actions in braces after all:
:0c
${DEFAULT}
:0
* !^From:.*\<donforward@domain\.com\>
{
:0fhw
| formail -i "From: changedemail@address.com"
:0
! other@recipient.net
}
And yes, the default action is to deliver to $DEFAULT
if the message was not successfully delivered by any recipe. You might want to invert the :0c
logic so that the original is delivered to your regular inbox (provided you don't have any later recipe which delivers it elsewhere) and the copy gets forwarded.
# Drop the $DEFAULT delivery from above
:0c
* !^From:.*\<donforward@domain\.com\>
{
:0fhw
| formail -i "From: changedemail@address.com"
:0
! other@recipient.net
}
For troubleshooting, it makes sense to run with VERBOSE=yes
. Add this directive before the problematic recipe, then examine the log output when a message arrives. For (much) more, see http://porkmail.org/era/mail/procmail-debug.html