<<< Date Index >>>     <<< Thread Index >>>

Re: SMTP via tunnel working at last, with nbsmtp



On Tue, Feb 03, 2004 at 08:49:51AM +0000, Chris Green wrote:
> On Mon, Feb 02, 2004 at 05:42:38PM -0500, David Yitzchak Cohen wrote:
> > On Mon, Feb 02, 2004 at 03:54:06PM EST, Chris Green wrote:
> > 
> > > I have finally got my sending via an ssh tunnel working, I found the
> > > most trivial MTA ever called nbsmtp, a single 'C' source file and a
> > > makefile is all there is.  Fortunately (for me) the Makefile knows
> > > about solaris.  So I built it and it worked straight away, unlike ssmtp
> > > and nullmailer neither of which I have managed to make work.
> > > 
> > > However there's one remaining question, how can I get mutt to do
> > > something like fetchmail's 'preconnect' so that I can fire off the
> > > required ssh command before running nbsmtp? The problem is that you
> > > need to start ssh without mutt seeing its stdin or stdout and then
> > > mutt sends the message to "sendmail" on its stdin (well nbsmtp
> > > actually).
> > 
> > The easiest thing should be to find a method of direct invocation for
> > nbsmtp, and have ssh run it for you on the target host, as the "command."
> > At that point, the ssh process becomes your "sendmail," and everything
> > should be all fine and dandy :-)
> > 
> Would that work, I hadn't thought of doing it that way round but I
> suppose it would make sense in a way.  It means I'll have to compile
> nbsmtp (or something else, presumably I could use sendmail directly)
> and in mutt I 'set sendmail' to something like:-
>     ssh -l cgreen -x remote.host /usr/lib/sendmail -oem -oi
> 
> I do actually have a shell login account on the remote system and have
> set up 'passwdordless' login using RSA authentication so I think this
> would work.
> 
> I'll try it an report if it works.
> 
... and it does, thanks very much for the suggestion, it makes things
much simpler with no need for a 'dumb MTA' at all.

So, if you have a shell login account with ssh you can tunnel mail
through ssh by something like:-

set sendmail="/proj/chris/bin/ssh -l cgreen remote.host /usr/lib/sendmail -oem 
-oi"

Where remote.host is the system where you have the ssh login.

The only downside is that there is a significant delay when you hit
'send' as the ssh connection has to be made and the message has to be
transmitted but I can live with that.

Thanks again!

-- 
Chris Green (chris@xxxxxxxxxxx)