RE: [Exim] headers remove for bounce mails?

Top Page
Delete this message
Reply to this message
Author: Eli
Date:  
To: 'Andrew J. Hutson', 'Exim Users'
Subject: RE: [Exim] headers remove for bounce mails?
Ah! I wasn't sure when/where it actually did the removal :)

I don't believe specifying a pass will do the trick though, but don't take
my word for it since I haven't tested this yet :) The way I read it in the
manual is, that if you specify pass and the router accepts it, any
modifications are still only for the router that accepts it - pass means it
passes an *original* copy of the message on for further routing, so no
modifications done by that intial router will be in the message passed -
it's more like each router gets an original copy, and pass merely passes
control over, rather than a message over to the next router. At least,
that's how I understood it :)

Eli.

-----Original Message-----
From: exim-users-admin@??? [mailto:exim-users-admin@exim.org] On Behalf
Of Andrew J. Hutson
Sent: Friday, January 09, 2004 6:19 AM
To: Exim Users
Subject: Re: [Exim] headers remove for bounce mails?


Eli: Point to note which it doesn't seem you're aware of: The actual
rewriting (adding & removing) of header lines isn't done until transport,
regardless of where you put the header_add & header_remove lines. If you
have a header_remove line in a router, it's contents is parsed and stored,
but the message is not actually modified until it reaches transport level.

Daniel: By the sound of it, you're trying to remove that header from all
mail? This is _probably_ possible using a system filter. There are two other
options which come to mind (I haven't tested either):
i) Add another router in front, perhaps using "pass" to just to the header
stuff. I'm not sure if "pass" maintains header alterations - it should do,
since the message is accepted, just not handled by the current router. It's
different from a router rejecting the mail.
ii) Do the header_remove at transport time (make sure it's on all transports
that might be used, so that the bounce passes through a headers_remove line
too).

>"the subsequent routers have no knowledge of previous
>modifications by other routers (even if a router silently accepts the
>message with unseen)."

This could be slightly misleading. The header_add and header_remove lines
aren't actually ignored. They are processed for the message on the current
router. This is because of the way unseen works: It creates a _copy_ of
message and passes _this_ on to the next router, keeping the first message
for itself. Therefore, the message handled by the current router (the one
with the unseen command) will get the headers modifications, but the next
router won't, since no rewriting has actually been done to the message yet.

Hope that makes sense!

Regards,

Andrew Hutson

----- Original Message -----
From: Eli
To: 'Daniel Tiefnig' ; exim-users@???
Sent: Thursday, January 08, 2004 4:37 PM
Subject: RE: [Exim] headers remove for bounce mails?


I don't think you can do this via routers or transports. It *might* work
via a system filter, but I am not sure.

The reason that it doesn't remove the header in the bounce is because if you
read very carefully how routers work with adding/removing headers (basically
anything that modifies the message at routing time), each router is given a
copy of the *original* message as it were when it entered the routers
section. So, your router that removes that header only removes the header
if it accepts the message. If the router rejects the message and control is
passed to the next router, any modifications that were made by that first
router are discarded - the subsequent routers have no knowledge of previous
modifications by other routers (even if a router silently accepts the
message with unseen).

So, when your bounce happens - it's happening probably because none of your
routers accepted the message, and so exim bounces it, however it bounces it
with the original message.

I'm not sure if this is something that may be useful or not - when I first
tried to add/remove headers, I did it in the routers section and quickly
found out that it didn't do what I expected - nor was there a router which
allowed me to modify a message but pass that modified copy to the other
routers (sort of like if there were a new router driver that accepted the
message, let you modify it, and then pass control on to the next router, but
sent the newly modified message rather than having the next router use the
original).

I think the reasoning for this is that after the ACL stage, right before
routing stages, the message is saved to disk, so to save on disk I/O and
maybe memory, no changes are done to the file/message on disk once it's
accepted. I wonder though that if there really would be any sort of memory
saving over just keeping the message (or maybe at least the headers section
and whatever part of the message body is set to be saved in variables and
whatnot) and modifying it in memory, and when a router accepts it and passes
it to a transport or whatever, the new changes could be synced to disk.

It would be nice to be able to remove headers in the ACL stage too (so that
if you have headers being added by a warn message, you could remove any
traces of headers before you add your own to make sure that only one copy of
the header is in the message), but I don't think that will happen any time
soon?

Eli.

-----Original Message-----
From: exim-users-admin@??? [mailto:exim-users-admin@exim.org] On Behalf
Of Daniel Tiefnig
Sent: Thursday, January 08, 2004 8:38 AM
To: exim-users@???
Subject: [Exim] headers remove for bounce mails?


Hi there,

I've a dnslookup router that does

headers_remove = X-Inode-Mail-Header

which works quite well, but if a message can not be delivered, the
bounce Mail quotes all headers of the original mail, including the
X-Inode-Mail-Header thingy. This matches with what is said at
"headers_add" in the routers section in the manual, but is not how I'd
like it to be.

Is there a way to remove headerlines from the quoted headers in the
bounce Mail? (I.e. not let them get there at all, I'd say.) I can't see
one, besides parsing the body of the bounce mail, or adding a mail proxy
in the first pass, which both is not what I'm going to do, though.


TIA,
daniel

--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
details at http://www.exim.org/ ##

---
[This E-mail scanned for viruses]


---
[This E-mail scanned for viruses]


--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
details at http://www.exim.org/ ##


--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
details at http://www.exim.org/ ##

---
[This E-mail scanned for viruses]


---
[This E-mail scanned for viruses]