Mutt with SSMTP

Here is how you set up Mutt without a working sendmail or exim installation. Most linux boxes I work with already have some kind of mail transfer agent installed by default, so I never really had to do this. My cygwin install on the other hand only had a bare bones, minimalistic ssmtp application that forwards emails to an SMTP server. This is in fact perfect for my needs. Here is how you set it up.

First you tell mutt where is your MTA – add this line to your .muttrc:

set sendmail="/usr/sbin/ssmtp"

You may need to configure your ssmtp to send out the emails properly. Here is what you should have in /etc/ssmtp/ssmtp.conf:

root=username@youremail.com
mailhub=smtp.yourisp.com
rewriteDomain=youremail.com
hostname=youremail.com
FromLineOverride=YES

Note that mailhub is the address of the SMTP server provided by your ISP. For example, in my case I would use smtp.comcast.net as mailhub, but andterminally-incoherent.com everywhere else.

SSMTP has an annoying tendency to rewrite the From line as it sends out emails. In my case it ended up being my_local_username@mydomain.com instead ofmyemail@mydomain.com.

To prevent this put this line into your /etc/ssmtp/revaliasses:

local_username:myemail@mydomain.com:smtp.myisp.com

Leave a Reply