Re: [exim-dev] RFC: implementing 551-redirection (client sid…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Philip Hazel
Data:  
Para: Robert Millan
CC: exim-dev
Asunto: Re: [exim-dev] RFC: implementing 551-redirection (client side)
On Fri, 14 Jul 2006, Robert Millan wrote:

> I've been looking at how could 551 redirection be implemented in the
> client side. I.e.: when server responds with 551, exim would parse the
> error string, obtain an address, and then recurse/iterate to send the
> message to final recipient.


This is not at all easy to do in full generality, if at all.

> Basicaly I can think of two ways to implement it. I'm not sure which
> one is best (please enlighten me):


I don't personally think it's possible, due to the way Exim is designed.
Certainly not without major re-design and lots of work.

> - In src/transports/smtp.c, hook a check for "551" before the ones for "5xx"
> and "4xx" in the loop inside sync_responses().


And then do what? You are trying to do a redirection, but you cannot
call the routers from within a transport, in order to route the new
address, because of loss of privilege and in any case the transport is
running in a subprocess.

> - In src/transports/smtp.c, process "551" much as if it were a "4xx".
>
> Problem: We don't really want to delay the sending, but this will
> postpone it untill the next queue run. Also, we would have to
> modify the spool file in order to replace the recipient, which I
> suppose is a really ugly thing.


I suppose it might just be possible to do it that way. You would have to
modify the recipients list in memory rather than the spool file, in a
similar way to the handling of one_time in the redirect router.[*] This
would require work to pass the information back from the transport
process to the main Exim delivery process.

> Please excuse me if I said something silly. I have no expertise with Exim
> internals (what I said above is just my attempt at guessing at how it works).


I think you'll find it doesn't work quite the way you expect.

Final thought: How to check against loops?

-------------
[*] The spool file is updated once only, at the end of a delivery
process. This is done by rewriting the file, and renaming. Modifying in
place is not considered (by me, at least) to be safe enough.

-- 
Philip Hazel            University of Cambridge Computing Service
Get the Exim 4 book:    http://www.uit.co.uk/exim-book