Steve Lorek

Configure Postfix on OS X Lion to Relay via Gmail

Today I had to test e-mail delivery of an app I was working on from home. Annoyingly, my ISP (O2) block outgoing port 25 because they don't trust their users not to run open mail relays. This meant that e-mails sent from my app were not being delivered.

So I needed to set up Postfix (the native Sendmail implementation running on OS X Lion) to relay all outgoing mails to another mail server. It turned out to be quite difficult to configure Postfix to connect to Gmail.

Gmail requires an authenticated TLS session to relay mail. But the instructions I found across the web did not seem to work, in that the Gmail CA certificates were not trusted even after adding them.

The easy solution was to simply stop Postfix from requiring a trusted CA altogether. Below are instructions to replicate my setup.