How to Enable Local SMTP Server (Postfix) on OS-X Leopard

Posted May 10, 2009 // 10 comments
Irakli:

OS-X Leopard comes pre-installed with a Postfix version. No need to install it via darwin ports or other third-party source (actually uninstall it if you have previously manually installed it via ports or something similar). Postfix just needs to be enabled and following sequence of several easy steps explains how to do it:

sudo vi /System/Library/LaunchDaemons/org.postfix.master.plist

add following line before the closing </dict> tag:

<key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/>

Start service with

$ sudo launchctl
launchd% start org.postfix.master

You can also start simply with “sudo postfix start” but the above command will start via launch sequence and test the configuration you edited in the previous step.

Check that SMPT is running:

telnet localhost 25

For more information, see: Mac OS X Manual Page For launchd.plist

About Irakli

Irakli is Director of Product Development at Phase2 Technology. His main responsibility is development of packaged, turn-key solutions using open-source technologies and cutting-edge semantic APIs.

Irakli has been an avid open-source ...

more >

Read Irakli's Blog

Comments

by Jim (not verified) on Tue, 05/12/2009 - 23:44

thanks that actually worked

Thanks very much! Some other instructions didn't work.

by David (not verified) on Fri, 05/15/2009 - 02:21

Thank you for posting these

Thank you for posting these instructions, but after I enter this:

launchd% start org.postfix.master

I get the following error:

launchctl start error: No such process

Do you know of some other things I should check?

I also tried the following at the top of the file: <key>Disabled</key> <false/> or <key>Enabled</key> <true/>

It started off as <key>Disabled</key> <true/>

by irakli on Mon, 05/25/2009 - 23:31

XML Source

David,

it should work. Please make sure your /System/Library/LaunchDaemons/org.postfix.master.plist looks something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>org.postfix.master</string>
        <key>Program</key>
        <string>/usr/libexec/postfix/master</string>
        <key>ProgramArguments</key>
        <array>
                <string>master</string>
                <string>-e</string>
                <string>60</string>
        </array>
        <key>QueueDirectories</key>
        <array>
                <string>/var/spool/postfix/maildrop</string>
        </array>

        <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/>
</dict>
</plist>

Also try opening the plist file in the Plist Editor, instead of a text editor, to see what OS-X sees, by running:

> sudo open /System/Library/LaunchDaemons/org.postfix.master.plist

by David (not verified) on Tue, 06/09/2009 - 13:39

Thank you for the

Thank you for the suggestions. I updated my file to match yours exactly, and confirmed that the referenced directories and files already existed. I also opened it in the Plist editor, and it looked right there - visual list of what was in the xml file.

Unfortunately, I still have the same result: launchctl start error: No such process

I also get that if I try "stop" instead of "start".

I appreciate you taking the time to put these instructions together. I just wish it would work for me. :/ There's probably something I did a long time ago and have completely forgotten about, that is preventing this from working today.

by Giovanni (not verified) on Tue, 07/21/2009 - 10:36

Thanks

It works :-)

by Dan (not verified) on Fri, 08/21/2009 - 16:14

shaaaweeet

Thanks for posting this...

Will this always start as a service from now on?

by irakli on Fri, 08/21/2009 - 17:14

yes

You are welcome.

Yes it should start itself after computer reboot.

by Antonie (not verified) on Thu, 10/15/2009 - 08:47

Getting it to work?

Hi Irakli,

I've done the command lines etc. in Terminal, all seems to be working fine. But how do I now set it up in Mail to get the SMTP to work?

by tamias (not verified) on Tue, 12/29/2009 - 10:37

Hi Irakli, after I enter

Hi Irakli, after I enter this:

$ telnet localhost 25

I get the following error:

Trying ::1... telnet: connect to address ::1: Connection refused Trying fe80::1... telnet: connect to address fe80::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 iMac.local ESMTP Postfix

500 5.5.2 Error: bad syntax

500 5.5.2 Error: bad syntax

500 5.5.2 Error: bad syntax 421 4.4.2 iMac.local Error: timeout exceeded Connection closed by foreign host.

___ Thanx!

by Anonymous (not verified) on Wed, 07/14/2010 - 17:46

slight problem, and solution

I had to enter the keys on separate lines in order to get this to be recognized, when I tried using:
sudo open /System/Library/LaunchDaemons/org.postfix.master.plist


1
2
3
4
5
6
        <key>AbandonProcessGroup</key>
        <true/>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <true/>


the way I figured out the format it would recognize them in is by just adding them through the plist editor, then saving the file there, and looking at it.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <strong> <code> <p> <img> <ul> <ol> <li> <h2> <h3> <h4> <b> <u> <i>
  • You may insert videos with [video:URL]

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.