About

libESMTP is a library, written by Brian Stafford, which allows the easy integration of SMTP support for sending messages to applications. Some email applications (such as Balsa), use libESMTP extensively.

This patch allows mutt to use libESMTP to send mail via SMTP instead of invoking the sendmail binary directly. To use it, set the smtp_host variable to be your SMTP server in your .muttrc. If you are running sendmail on your local computer, you can set smtp_host to be "localhost". If you wish to deliver mail to a port other than 25, you can use the smtp_port variable — 587 is a common alternative.

To use SMTP AUTH support, set smtp_auth_username in your .muttrc to the user you wish to authenticate as. If smtp_auth_password is also set, mutt will use this password during SMTP AUTH; otherwise, you will be prompted for the password when sending mail for the first time.

The libESMTP patch now supports TLS to prevent sending your SMTP password in the clear. If your SMTP server supports TLS, it will be used if the variable smtp_use_tls_if_avail is set to yes (the default). To require TLS in all circumstances (and fail if TLS isn’t supported by the SMTP server), set the variable smtp_require_tls to yes. Thanks to Shaun Eack at Wolfram for providing the initial version of the patch.

If you have any comments, please email me at sengelha AT yahoo DOT com.

ChangeLog

  • 2006-03-07: Version 4. Support SMTP TLS.
  • 2003-03-05: Version 3. Properly set the envelope From address using libESMTP. I don’t know what I was thinking before; maybe I thought libESMTP would magically detect the envelope From from the mail itself.
  • 2003-01-16: Version 2. Supports SMTP AUTH.
  • 2002-09-12: Version 1. Supports plain SMTP connections to an arbitrary host and port.

Download

Download the latest patch:

How to Apply

The below directions apply to mutt 1.4.2.1, but they may be easily adapted for your version of mutt.

  1. Download mutt 1.4.2.1 from a mirror listed here.
  2. Download the patch above.
  3. Untar the mutt source code. It will be put into the directory mutt-1.4.2.1.
  4. Without changing directories, apply the patch by running patch -p0 < patch-1.4.2.1.sde.libesmtp.4.
  5. Change into the directory mutt-1.4.2.1.
  6. Run the following command: aclocal -I m4 && autoheader && (cd m4 && make -f Makefile.am.in) && automake && autoconf. Note that mutt 1.4.2.1 requires autoconf 2.13 and automake 1.6.
  7. Run configure, make, and make install as usual. Be sure to specify the --with-libesmtp option to configure.

Why?

I wrote this patch for mutt for these reasons:

  • I wanted support for SMTP AUTH so that I could use Yahoo’s SMTP servers for sending mail.
  • The idea of depending on the behavior of an external binary (namely sendmail) and (possibly) having to parse its textual output is, IMHO, a bad idea.

Previous Versions

Similar Projects

  • ESMTP solves the problem by writing a replacement sendmail-compatible external MTA.