Configure sendmail to use Mandrill as SMTP relay

  13 Oct 2014

Some of applications that installed on Linux usually expect sendmail to work but the problem is it does not always work ( at least with default configuration/installation via apt-get etc. ) I’m pissed off with this and people usually recommend to use another tools ( you name it ). You may be very lucky if it just works at the first time you installed. Sometimes, though, we just want to make the default installation work! ( in my case, recent failed is DokuWiki on Ubuntu ) without any application specific modification.

However, there is sort of hidden configuration for sendmail that people ignore. That is you can set an SMPTP relay host with sendmail called SMART_HOST. To do so, you could follow this steps:

  1. Define SMTP relay host and credentials.

Use your SMTP/API Username and Password in, put in the following file in the format like this:

cat > /etc/mail/authinfo "U:USERNAME" "P:PASSWORD" "M:PLAIN"

Also, at the bottom of /etc/mail/ file, add following lines:

    define(`SMART_HOST', `')
  1. Regenerate /etc/mail/ file by:

     cd /etc/mail
  2. Then, restart sendmail:

    service sendmail restart
  3. Test sending email run: sendmail

And, enter the following:

Subject: Hello test

Hi, ignore. this is my test message

Finally, check your recent activity at

comments powered by Disqus