OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Using ssh tunnels...

From: /dev/rob0 (rob0gmx.co.uk)
Date: Sun May 22 2005 - 23:42:54 CDT


On Sunday 22 May 2005 23:27, mobiru wrote:
> TO secure some privacy and security I set up ssh tunnelling to the
> pop server to fetch mail and another to the smtp server to send mail.
> All this is done more or less manually.
>
> I set up an expect script to handle fetching the mail but I have not
> found out how to set up to send mail. Mail must go through a secure

Forward the remote port (25 or 587?) to a port on your end. Set up a
transport(5) table (and add it as transport_maps in main.cf) to use
[localhost:yourLocalPort]. Sounds like you might want that as your
relay_host.

> I want to be able to queue up outgoing mail when not on the network
> then have it delivered via ssh tunnel when the network is up.
> Basically, it has to set up an ssh tunnel on demand, by itself, to
> the outgoing mail server only when the network is up. Can I somehow
> persuade postfix to do this?

Probably, using pipe(8) and passwordless public key authentication to
initiate the tunnel. But this is an example of using a hammer where a
screwdriver would make more sense. I'd use openvpn for this. The fun
and power of Unix is the myriad of small tools that do one job well,
and when chained together can do amazing things.

> I have looked at the docs and dug through the Ora book on postfix
> without finding what I need.

Not surprising, because this has little to do with Postfix. You might
want to ask the SSH details on an OpenSSH forum.
--
    mail to this address is discarded unless "/dev/rob0"
    or "not-spam" is in Subject: header