How to Configure Postfix to Mandrill SMTP on Mac OSX

Posted on

In my previous post, I talked about how to install postfix mail server on mac OSX. At that time, I used Gmail SMTP for sending the emails. This article will show you how to configure Mandrill SMTP for postfix.


  1. You already have postfix installed and configured like in this post.
  2. You have Mandrill account and created the Mandrill SMTP credentials.

Ensure the Hostname is FQDN

I think this is important for Mandrill app to work. You need your hostname has FQDN format. Try to type

$ hostname -f

It must be like this domain.tld. FYI, mine is Budis-MacBook-Air.local. I thought It wouldn't work using .local but Mandrill still accepts it.

Change Postfix Credentials

Go to terminal and type

$ sudo vim /etc/postfix/sasl_passwd

Change the username and api key with yours.

[]:587 your_mandrill_username:your_mandrill_api_key

Anytime you change the credentials, you need to run postmap

$ sudo postmap /etc/postfix/sasl_passwd

Change Postfix Setting

The settings will be quite different. Type below to open postfix setting file.

$ sudo vi /etc/postfix/

And make some changes like following.

relayhost= []:587
smtp_sasl_security_options= noanonymous

Save and then don't forget to reload postfix

$ sudo postfix reload


Here is the command you need to execute to test postfix. Please change your_email and your_domain with yours.

$ echo "Test sending email from Postfix Mandrill" | mail -s "Test Postfix Mandrill" your\_email@your\

If success, you will receive test email in your inbox.



In article, we use Mandrill SMTP for Postfix. The configuration is not much difference with Gmail SMTP but Mandril offers more email that can be sent every month than Gmail.