problems with Mutt and esmtp

Ross A. Beyer rbeyer at
Thu Apr 8 10:06:39 PDT 2004

I'm having a problem getting the Mutt and esmtp programs to work
together.  What happens is that when I run Mutt and hit send, Mutt
will just hang forever displaying its "Sending message..." message.
I think that it might be something to do with the sending of the
control character signalling the end of message, but I don't know
for sure.

I'm running FreeBSD 4.9-STABLE (rebuilt this past weekend),
esmtp-0.5.0_1, and mutt-, which are the most recent of things.

I've simplified the config files for each program 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

identity = rbeyer at
  hostname = localhost:2525
  preconnect = "ssh -f -C -L 'sleep 5'"

set envelope_from=yes
set from="rbeyer at"
set sendmail="/usr/local/bin/esmtp -v -X esmtp.log"

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.  However, after
that nothing happens until I eventually get fed up and kill the
mutt process.

I find that if I run "/usr/local/bin/esmtp -v -X esmtp.log -f
rbeyer at -- rbeyer at" from the command line,
I get similar results before I start typing, everything is set up,
but waiting for user input.  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 at 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

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.  Then, on the command line I
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. 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, so Mutt is working (and certainly I use Mutt on other
systems to happily send and receive mail).  The problem is definitely
where esmtp and Mutt communicate, as both seem to work fine

Have I missed a configuration variable either in esmtp or in Mutt
that is causing this problem?

I searched around the net and the FreeBSD mail lists and couldn't
find anything relevant to this problem, so I'm thinking that maybe
I've screwed something up since everyone else seems to be having
no trouble.  I also contacted the esmtp author, Jose Fonseca, and
he isn't aware of this problem, and says that everything works fine
for him.  Is it something particular to FreeBSD?

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

More information about the freebsd-questions mailing list