> > workaround is to establish SSH port forwarding asynchronously, and that
> > is a fragile setup that I would like to replace by something synchronous

> You need to make smtp(8) talk to a TCP port (or UNIX-domain port),
> an arrange for a little daemon that listens on that port, and that
> invokes ssh when a connection is established to that port. Then
> the little daemon shuttles bits up and down. Such an on-demand
> TCP relay could be done in Perl, Python, or any capable language.

If stunnel is not an option I'd prefer autossh.
It preopens the tunnel and restarts if needed.
It is rock stable and it is off the shelf.

Gabor

Reply via email to