[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: exim4 and SSH tunneling



On Thu, 2005-11-24 at 21:19 +0100, Björn Lindström wrote:
> Alex Malinovich <demonbane@the-love-shack.net> writes:
> 
> > You could just use an SSH tunnel FROM port 25 on localhost TO port 25
> > on the smarthost. For example:
> >
> > ssh -L25:localhost:25 -N your.smarthost.org
> >
> > That way anything that goes out on port 25 on your local system will
> > come in on port 25 of the remote system. So exim will still answer it
> > as a default SMTP connection.
> 
> Excellent, though I assume you meant -L25:my.smarthost.org:25 there.

As long as exim is listening on localhost as well as the public
interface using localhost would still work. The specified in the L
argument is resolved from the side you are connecting TO. So localhost
would resolve to 127.0.0.1 on the same machine that has the
my.smarthost.org address.

> For the benefit of googlers, here's the solution I arrived at.
> 
> I created a user called smtp-tunnel on the smarthost, and gave root on
> the client machines rights to log into that machine with a key. Then I
> run
> 
> sudo autossh -f -N -L 25:nuala.thaning.se:25 smtp-tunnel@nuala.thaning.se
> 
> After that, I just 'dpkg-reconfigure exim4-config' to have it use
> nuala.thaning.se as a smarthost.
> 
> Lots of thanks for the hint.

Glad to help.

-- 
Alex Malinovich
Support Free Software, delete your Windows partition TODAY!
Encrypted mail preferred. You can get my public key from any of the
pgp.net keyservers. Key ID: A6D24837

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: