next up previous contents
Next: Choosing Your Editor Up: Configuring Mutt Previous: Downloading Mail: Fetchmail   Contents

Sending Mail: Sendmail and Friends

Starting with version 1.5.17, mutt now - miracle of miracles - has the capability of sending your messages without the need for another program like sendmail. This goes essentially against the mutt philosophy, but was requested by enough users that the decision was made to include SMTP capability. To take advantage of this, in your muttrc file you would add your log in information in the following format:

set smtp_url="smtp[s]://[user[:pass]@]host[:port]/"

Let's say you have a mail account whose SMTP address is outmail.mailhost.com, where you log in using the name `squeaker' with password `bear.'

set smtp_url="smtp://squeaker:bear@outmail.mailhost.com"

Another way to send mail (actually, until 1.5.17, the original way) is to configure a mail transport agent, like sendmail. For old time's sake, and for those using older versions of mutt, this is how to do so. Provided sendmail, postfix, qmail, or another SMTP mail sending program has been installed and configured on your system, simply tell mutt where to find the sendmail program. In most cases, sendmail is located at /usr/sbin/sendmail, so the following line should suffice (you can also enter ``whereis sendmail'' at a command prompt to find sendmail if this is not the correct location). Postfix even provides a simlink at that location to deal with mail programs expecting to find sendmail there. So once you know where to find sendmail, put a line in your .muttrc file that tells mutt where to hand off written mail for sending, as follows:

set sendmail=/usr/sbin/sendmail

However, installing and configuring Postfix or Sendmail is not fun in an age when any self-respecting ISP requires authentication to stem the spamflood, so choosing a distribution that does this for you, like SUSE, will take a lot of pain out the process (Ubuntu users, are you listening?). However, if you're just a casual emailer instead of a systems administrator, and just need a simple and easy way to get your mail to your ISP, perhaps a full-blown Postfix configuration is overkill. There are several alternatives created for the likes of mutt users who just need an easy way to send mail to their ISP, and nothing fancier than that.

One is ``ssmtp,'' a package that allows you to send mail via the SMTP protocol to your ISP, authenticating with a username and password. For most people, that's all you need to do anyway, and choosing this option simplifies the process of installing mail transport agents that were really intended to go on servers and handle immense volumes of mail, spam, and bounces every day.

If that's the mechanism you choose, your .muttrc file should look like this:

set sendmail="/usr/sbin/ssmtp -audUserName@domain -apSecretPassword"

Just as easy, if not easier, is Putmail.py, a tiny python script that provides a dead simple interface for sending mail. It's a simple 13 KB download and an even simpler 5 line configuration file, and you are up and running. Once it is working you can even configure other software to use it, such as the slrn newsreader. This is now my preferred configuration on the Macintosh, which lacks easy postfix configuration utilities, while on SUSE I stick with YaST2 and Postfix.3

There are several other light SMTP agents that do what the ssmtp program does, including esmtp, msmtp, nullmailer, and others. See the Mutt Wiki for a complete list (see section 7). Otherwise, welcome to the wonderful world of configuring mail transfer agents. That task is beyond the scope of this guide. The most useful resource for configuring postfix for the purposes of a mutt user (that is, you just need it to send mail to your ISP) is located at: http://postfix.state-of-mind.de/patrick.koetter/smtpauth/smtp_auth_mailservers.html.


next up previous contents
Next: Choosing Your Editor Up: Configuring Mutt Previous: Downloading Mail: Fetchmail   Contents
Randall Wood 2008-03-05