Re: [Exim] Detecting and routing locally generated messages

Pàgina inicial
Delete this message
Reply to this message
Autor: Nico Erfurth
Data:  
A: everton, exim-users
Assumpte: Re: [Exim] Detecting and routing locally generated messages
Everton da Silva Marques wrote:
> Hello.
>
>
> According to section 3.4 of Exim 4 Specification [1], there
> are 4 methods a locally running process can use to issue
> a message to Exim:
>
> 1) -bm option
> 2) -bS option
> 3) -bs option
> 4) TCP call to loopback address
>
> I would like to route those locally generated messages in a
> specific way.
>
> QUESTION:
>
> How can one to reliably detect a locally generated
> message (issued by a locally running process)? Is
> it possible to write a router which handles only
> messages received through one of those 4 methods?
> Or, at least, through the first 3 three (which
> don't involve TCP/IP) ?
>
> Any hints greatly appreciated.


in conditions you could use $interface_address and $host_address
they SHOULD be equal for commandline (empty strings) and local tcp
connections (same ip)

condition = ${if eq {$interface_address}{$host_address}{1}}

this will not work in any case, if the client binds the outgoing
connection to an specific ip and connects to another one (if you have
virtual interfaces or something like that) the addresses will not be
equal. But youc an use explicit checks for the addresses in suche a case.