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 and terminally-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 of myemail@mydomain.com.

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

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

This should do it. Enjoy! )

Related Posts:

  • Using IMAP with Mutt
  • A day without X
  • Are You Clueless?
  • What does your favorite text editor say about you?
  • What does your browser reveal about you?

  • 5 Responses to “Mutt with SSMTP”

    1. Gravatar Peter Andersson SWEDEN Says: Reply to this comment

      Thanks alot, I found this extremely useful, my ISP blocks port 25 so I have to forward my mails when using mutt. I had never heard about ssmtp, works like a charm now )

      Posted using Opera Opera 9.10 on FreeBSD FreeBSD
    2. Gravatar Arturo Rdz MEXICO Says: Reply to this comment

      Thanks a lot Sir.
      Very useful , you can type too:
      mutt -s “Testing from MUTT” ivan.dimitrov@training.compliancevault.com Hola
      > que tal
      > probando
      > test
      > EOF

      ..and the message goes… great!.

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.2 on Ubuntu Linux Ubuntu Linux
    3. Gravatar Luke UNITED STATES Says: Reply to this comment

      Glad I could help. )

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.2 on Windows Windows XP
    4. Gravatar Terminally Incoherent » Blog Archive » A day without X UNITED STATES Says: Reply to this comment

      […] I previously covered Mutt several times, showing you how to set it up for IMAP and how to send out emails without full blown sendmail or exim setup just using basic SSMTP. There is also Pine which is a damn fine mail client too - if you can deal with editing your messages in pico. […]

      Posted using WordPress WordPress 2.0.5
    5. Gravatar Un giorno senza X… « Note su LINUX Says: Reply to this comment

      […] Ho precedentemente dedicato parecchio tempo a Mutt, facendo vedere come settare IMAP come inviare email con sendmail o exim usando SSMTP. […]

      Posted using WordPress WordPress MU

    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <pre lang=""> <em> <i> <strike> <strong>

    [Quote selected]