procmail
[Top] [All Lists]

Re: forwarding

1997-01-29 15:37:37
bts8(_at_)netcom(_dot_)com writes:
I have a recipe that looks similar to:

:0c:
* ^From.*someone
! address(_at_)otherhost(_dot_)com
:0a:
Someone

What I'm trying to accomplish is send a copy of the message to myself at 
another address while still keeping a copy in the folder called 
"Someone".  This works but I'd like to improve it a little.  Can it be 
simplified?  Can the "X-Loop:" header be added easily?  Thanks!


Remember: the '!' action is simply a shorthand for:
        | $SENDMAIL $SENDMAILFLAGS
To stick formail into the chain, expand the shorthand, then insert
the proper formail command.

:0c
* ^From.*someone
* ! ^X-Loop: bts8(_at_)netcom\(_dot_)com
| formail -A"X-Loop: bts8(_at_)netcom(_dot_)com" | \
        $SENDMAIL $SENDMAILFLAGS address(_at_)otherhost(_dot_)com
:0a:
Someone


Note that you don't need a locallockfile on the first recipe.  Indeed,
your logfile should have several lines saying "Extraneous lockfile ignored"
or something like that.

Philip Guenther

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