procmail
[Top] [All Lists]

Re: Forwarding a message, but keeping a copy

2000-01-10 02:36:56
On Mon, 10 Jan 2000 10:57:28 +0200, "Marc Blum" 
<gblum(_at_)icon(_dot_)co(_dot_)za>
wrote:
I need help with procmail. what I would like to do is forward all
inbound mail to a second email address, while keeping a copy at the
current email address. Sothat when I get sent an email I will be
able to download it from both servers and it will look identical.

This sounds like begging for trouble. But if you don't mind the risks,
you don't even need Procmail for this. The plain old .forward syntax
of Sendmail has everything you need.

Let's say your local login name is "gblum", and you would like to also
forward to "marc(_at_)example(_dot_)com". Then you'd put in your .forward file
this:

marc(_at_)example(_dot_)com
\gblum
# notice the backslash there! Prevents Sendmail from looping

Mail loops are a more serious problem than you might think. If you
were to set up a similar arrangement at both accounts, the mail loop
you thereby create will mail bomb the weaker server back to the stone
age.

This, of course, is where Procmail comes in handy; it lets you
+selectively+ forward mail.

    :0
    * ! ^X-Loop: marc\+been-there-done-that(_at_)example\(_dot_)com
    | formail -A "X-Loop: marc+been-there-done-that(_at_)example(_dot_)com" \
      | $SENDMAIL $SENDMAILFLAGS marc(_at_)example(_dot_)com

This will add the X-Loop header and forward to marc(_at_)example(_dot_)com only
mail which does not already have this X-Loop header. That means the
mail on the two accounts will not be +exactly+ identical, because the
headers will be different (but they will anyway -- your local
Received: lines will be different, too).

Most of this is in the procmailex manual page, by the way.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>

Please turn off this "feature" in your "mail program". Thanks.

Hope this helps,

/* era */

-- 
 Too much to say to fit into this .signature anyway: <http://www.iki.fi/era/>
  Fight spam in Europe: <http://www.euro.cauce.org/> * Sign the EU petition

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