Subject: How do I bounce mail through procmail?

From: Christine Hsu <[email-masked]>
Date: Thu, 13 Oct 94 10:18:48 PDT

Hi,

I just started using procmail, and am using it for filtering out
some of my messages and forwarding the rest to a different machine.

The problem with doing this is that on the other machine it comes
in looking like its from me, and I'd like to have it say who it is
really from-- so what I'd really like to do is bounce the message
to the other machine instead of forwarding it.  Does anyone know
how I can do this?  Sorry if this is a FAQ-- I just joined the mailing
list yesterday and haven't found a FAQ yet.

-Christine
 [email-masked]

---

From: Adam Shostack <[email-masked]>
Date: Thu, 13 Oct 94 13:47:21 EDT

You wrote:

| The problem with doing this is that on the other machine it comes
| in looking like its from me, and I'd like to have it say who it is
| really from-- so what I'd really like to do is bounce the message
| to the other machine instead of forwarding it.  Does anyone know
| how I can do this?  Sorry if this is a FAQ-- I just joined the mailing
| list yesterday and haven't found a FAQ yet.

	You really need to include the .procmailrc stuff you are using
to get the undesirable results.  Using a rule such as:

:0:
* ^From ([email-masked][email-masked])
! abcd-security@abcd

Will make any mail from the cert-advisory or ciac-bulletin lists
bounce to abcd-security@abcd, appearing to come from their respective
senders.  (Acutally, this is a gross simplification, but should make
your mail bounce the way you want.)

	Something like the following will make the mail come from you.
I would guess you are doing something like this, with mail ending up
in a '| $SENDMAIL' or '| Mail' at the end of the rule.

:0
* ^From ([email-masked][email-masked])
{
   SUBJECT=`formail -zx Subject:`

   :0Wc # strip down headers, indent whole, and remail
   | formail -bk -X Subject: -XDate: -XFrom: -XReply-To: | \
   sed 's/./> &/' | elm -s "(fwd) $SUBJECT " abcd-security@abcd
}

Adam

---

From: Roman Czyborra <[email-masked]>
Date: Thu, 13 Oct 1994 20:18:09 +0100

> really from--

If you use procmail's ! forward action the From: line should pass
through and that is the line modern (RFC 822 was published in 1982)
mail readers look at.  The envelope From_ will have changed to your
address for a good reason: if you forward to a broken address you need
get the error message not the person who sent you the mail.

If you need to keep the original envelope From_ you can either forward
a copy of every mail you get by adding the other address directly to
your .forward file or if you have procmail-3.10 you can do

	:w
	^^From \/[^ ]+
	! -f "$MATCH" hsu_christine/[email-masked]

---

From: [email-masked] (Stephen R. van den Berg)
Date: Fri, 14 Oct 1994 13:30:23 +0100

>	! -f "$MATCH" hsu_christine/[email-masked]

However, the preferred way to fix this would be to use a procmail recipe at
the receiving end.  I.e. at the openmail account feed all forwarded mail
through:

	:0 hfw
	| formail -I "From " -a "From "

-- 
Sincerely,                                  [email-masked]
           Stephen R. van den Berg (AKA BuGless).

"Good moaning!"