procmail
[Top] [All Lists]

Forward-copy

1997-04-09 12:51:00
How can i setup procmail to make a forward copy of incoming mail to
another account? I have two accounts and want the mail from the first one
to be copied (not just forwarded) to the other account. I've tried to
write some rules in the .procmailrc file but without success. Can anyone
please help me?

Try this:

:0 c
! you(_at_)other(_dot_)acct(_dot_)net

Err... if you happen to have two accounts, both running procmail, and
both forwarding, you need a little bit more in that recipe :-)
On one account (on machine 'your.main.mail.address'):
:0 c
* !^X-Loop: yourname(_at_)your(_dot_)main(_dot_)mail(_dot_)address
| formail -A "X-Loop: yourname(_at_)your(_dot_)main(_dot_)mail(_dot_)address" | 
\
             $SENDMAIL -oi yourname(_at_)the(_dot_)other(_dot_)account

On the other (on machine 'the.other.account'):
:0 c
* !^X-Loop: yourname(_at_)your(_dot_)main(_dot_)mail(_dot_)address
| formail -A "X-Loop: yourname(_at_)your(_dot_)main(_dot_)mail(_dot_)address" | 
\
             $SENDMAIL -oi 
yourname(_at_)your(_dot_)main(_dot_)mail(_dot_)address

Yes, the X-Loops are the same...

The X-Loop check will prevent an email loop.  I was bitten by one once
when I accidentally setup an auto-reponder to reply to anyone who sent
it email.  Then I sent myself some mail and went home to test it :-)  It
was perfectly happy to keep sending a response back to me, which caused
it to send another response, which caused another, etc.  When I next
checked my email I had approx 92 messages, each one slightly longer than
the last.

Please don't CC me when replying to the list.
-- 
Laurence Michaels <lmichael(_at_)gdc(_dot_)com>
Spam will be bounced.  You have been warned.

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