Use Postfix as Local SMTP Mac OS X

Written by
Date: 2012-03-16 21:11:00 00:00

As I'm constantly trying and changing my default email application on my Mac, I'm currently using Thunderbird, the native email application and also Pilot.

So, decided to use my own local SMTP in order to not store my credentials on each application, and for an easy configuration. Also because I like emails to go fast from y outbox. Then it will be Postfix responsibility to deliver the email properly.

The problem is that my laptop is constantly changing its IP, so most of my emails will not get its destinations if I try to deliver them directly from the Macbook.

What I did, was to configure postfix to relay on Gmail to deliver my emails.


There is nothing to install postfix is already installed on my Mac.


First things first, let's create a file to store our credentials.

sudo vim /etc/postfix/sasl_passwd

Then add inside something like this:

If you are using Google Apps, replace for your own domain.

Now run:

sudo postmap /etc/postfix/sasl_passwd

And finally prepare the postfix main configuration file.

sudo vim /etc/postfix/

And add these lines, check if they are not already present before you add them to your file.

mydomain_fallback = localhost
mail_owner = postfix
setgid_group = postdrop

Start the Service

sudo postfix start

Configure your Client to Use localhost as SMTP Server

Point your email client to point localhost at port 25, that is it.