Re: [exim] Smarthost through ssh-tunnel

Pàgina inicial
Delete this message
Reply to this message
Autor: Marc Sherman
Data:  
A: Dirk grosse Osterhues
CC: exim-users
Assumpte: Re: [exim] Smarthost through ssh-tunnel
Dirk grosse Osterhues wrote:
> Hello,
>
> I would like to tunnel a special email-address through ssh, because
> it's relayserver is firewalled. I want exim to trigger a tunnel when
> smarthost is required (not very efficient, but the address is not
> even used one time a day, so a permanent tunnel would be overkill).
> My question is: how do I tell the router or the transport for this
> specific smarthost to execute ssh before sending the mail?


How did you want to use ssh, to set up a port tunnel for the receiving
MTA using ssh -L, or to execute the receivng MTA/MDA directly on the
command line?

For the former, you might be able to put the ssh -L command in a script
called by the transport_filter option of an SMTP transport, but you have
to be careful that ssh is disconnected from stdin, and the script just
echo's stdin to stdout, so that the message itself isn't filtered. I'm
not sure if that would work, though, because the SMTP connection might
already be started before the transport filter is launched.

http://www.exim.org/exim-html-4.50/doc/html/spec_24.html#IX1951

For the latter, if the destination server can accept LMTP (which I
understand Exim cannot), you could use the LMTP transport, setting up
the ssh tunnel as the "command".

http://www.exim.org/exim-html-4.50/doc/html/spec_28.html

- Marc