procmail
[Top] [All Lists]

Re: Procmail forwarding problems

1999-10-13 08:10:07
Richard Gooch wrote,

| So I've using the '!' procmail action to forward mail to another
| address.
| 
| The problem is that now the '^From ' line contains the email address
| of my account from where I'm forwarding from.

That is not a problem.  That is exactly how it should act.

| What I want is to preserve the '^From ' line that was in the original
| message (which is the way it works with a conventional ~/.forward).

No, that is a bad thing, and I'm sure that after I explain, you won't want it
any more.  The way ~/.forward works is wrong.  Very likely there is a better
way to accomplish what you want without the negative consequences of failing
to change From_.

If the From_ address is not changed, and something goes wrong on the way to
your destination address, or you mistyped it in your .forward, then the
message will be bounced all the way back to the original sender, with an NDN
saying that the destination address couldn't be reached.  But the original
sender didn't write to the destination address and can't do anything to fix
your forwarding, and (s)he can't reach you to tell you that your forwarding
isn't working [because mail will just bounce back to him/her].  You can fix
the forwarding (or turn it off until the destination address is accepting
mail again), but with the bounces going back to the original senders you
don't find out; you just wonder why nobody is writing to you any more.

You, not the original sender, are the one who has to know if mail can reach
the forwarding point but can't get from there to the destination, so you are
the one who has to receive the bounce notices when that happens.  (In many
cases, a person who forwards mail might not even want senders to know the real
destination address, but that privacy goes out the window if the bounces go
to the original senders.)  Therefore From_ has to point to your forwarding
point, where your .procmailrc can recognize a bounce notice (say, by using
^FROM_DAEMON) and store them there instead of forwarding them along with the
rest of the mail.

| Is there are way around this?

Yes, but you're better off not getting around it.  If your real goal is to
have the incoming From_ information when the piece arrives at the destination
address so that you can match procmail recipes to it, you can do that without
the drawbacks, like this:

 :0hfw # if forwarded mail bounces back, don't forward it again
 * ! ^FROM_DAEMON
 | formail -zR 'From ' X-Incoming-From_:

 :0a
 ! destination_address

Then you'd get the original From_ information in an X-Incoming-From_: header
line, but if something goes wrong on the way from your forwarding point to
your destination address, you'd still get the bounce notice yourself, as you
should.

| P.S. please Cc me, as I'm not on this list.

Then you should join, at least for the duration of this discussion.

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