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

Mutt & esmtp not working together



In order to send e-mail via Mutt from my home machine, my laptop,
etc., I am trying to use esmtp, one of the mini-MTAs listed in the
Mutt Wiki, to forward my e-mail to my mailhost.  The problem is
that when I run Mutt and hit send, Mutt will just hang forever
displaying its "Sending message..." message.

That is the problem, the details of what I have done, and what I
have figured out are below.  I think that there is a problem in the
way that Mutt is calling esmtp, a gentleman was just asking how to
find out how to get more info from Mutt on this list, but he hasn't
said anything about the resolution to his problem, which seemed
similar.

I contacted the author of esmtp, and he says that there is nothing
wrong when he uses Mutt and esmtp together.  I'm running esmtp-0.5.0_1
and mutt-1.4.2.1, the latest of both.

I think that I have everything set correctly, and  I've included
my simplified  ~/.esmtprc and ~/.mutt/muttrc below.  I've simplified
the config files down for testing, and these are the only contents
of both files (and there are no system-level config files for either
in /usr/local/etc, this is it):

-----~/.esmtp----------------------------------------
identity = rbeyer@xxxxxxxxxxxxx
  hostname = localhost:2525
  preconnect = "ssh -f -C -L 2525:mail.rossbeyer.net:25 mail.rossbeyer.net 
'sleep 5'"
-----~/.esmtp----------------------------------------

-----~/.mutt/muttrc----------------------------------
set envelope_from=yes
set from="rbeyer@xxxxxxxxxxxxx"
set sendmail="/usr/local/bin/esmtp -v -X esmtp.log"
-----~/.mutt/muttrc----------------------------------

Additionally, I use ssh-agent, so no login/password is needed for
authorization to my remote mailserver.

I find that when I hit send, Mutt has successfully called esmtp (as
esmtp created its logfile, but hasn't written anything to it), and
that esmtp has properly created the ssh tunnel, and is running.
However, after that nothing happens until I eventually get fed up
and kill the primary Mutt process, and then have to manually go in
and kill the forked Mutt process that spawned the esmtp process.

I find that if I run "/usr/local/bin/esmtp -v -X esmtp.log -f
rbeyer@xxxxxxxxxxxxx -- rbeyer@xxxxxxxxxxxxx" from the command line,
I get similar results before I start typing (esmtp logfile gets
created, ssh tunnel opens).  Naturally doing this allows you to
type a message, hit control-D, then the process finishes, and I get
a very rough e-mail delivered to my rbeyer@xxxxxxxxxxxxx account,
so esmtp is working properly to some degree.

So I wonder if Mutt isn't talking to esmtp in the right way or esmtp
isn't listening in the right way?  More testing seems to confirm
this.

I wrote a little Perl program to put in place for the "set sendmail="
line in ~/.mutt/muttrc that simply captured the command line arguments
and STDIN, and wrote them to a file.  On the command line I then
turned around and fed those same command line arguments to esmtp
and redirected (with '<') the contents of the message file I had
captured from Mutt, and then everything worked just fine.  I wasn't
expecting that to work, so I'm kind of even more confused.

So I tried not using a tunnel, and just using esmtp for local
delivery via procmail, and the results are identical, hanging Mutt.
Clearly esmtp is running, it has created an empty log file, but
Mutt is just sitting there saying "Sending message...".  I can't
help but wonder if the message hasn't been sent but the correct
termination character isn't being sent or received properly.  When
I comment out the

set sendmail="/usr/local/bin/esmtp -v -X esmtp.log"

line in the ~/.mutt/muttrc, the mail gets delivered locally no
problem using the local sendmail, so Mutt is working (and certainly
I use Mutt on other systems to happily send and receive mail).


Have I missed a configuration variable either in esmtp or in Mutt
that is causing this problem?  Or is there something in Mutt (or
in esmtp) that is causing this.  Maybe it has something to do with
the very latest version of Mutt?  Which is why no one has complained
about it much?

Any help you can give me would be great, as I'm looking forward to 
using esmtp and Mutt together.  Thank you.
-- 
                                             Ross