Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Enabling the Postfix Mail Daemon on Leopard

If you want to send SMTP mail via localhost on Mac OSX Leopard (for example, from ActiveRecord/Rails/CruiseControl.rb/etc), you need to run postfix at boot. This took me a quite a while to figure out, so here is what worked for me on a work-imaged box and my personal box. YMMV.

  • First, Leopard comes with postfix, but I had numerous issues because I had the MacPorts version already installed on all my boxes for whatever reason. Here are the various error search strings for future googlers:
    • fatal: file /opt/local/etc/postfix/ parameter mail_owner: user postfix has same user ID as _postfix
    • fatal: open /usr/local/etc/postfix/ No such file or directory
    • fatal: open /opt/local/etc/postfix/ No such file or directory
  • So, I ended up uninstalling the MacPorts version:
    $ sudo port uninstall postfix
    • Strangely, after this, I still get a version @2.5.4 returned by “sudo port list postfix“, even though the uninstall was apparently successful. I don’t know enough about MacPorts to know why, maybe this is reporting the Leopard-installed one???
  • Next, I edited the plist file to start postfix automatically on boot:
    $ sudo vi /System/Library/LaunchDaemons/org.postfix.master.plist`
    • Add these entries at the bottom, in the ‘dict’ element
  • Reboot
  • Make sure SMTP port 25 is open on localhost
    • $ telnet localhost 25
    • Look for something like the following, showing you connected successfully on localhost:
      Trying ::1...
      telnet: connect to address ::1: Connection refused
      Trying fe80::1...
      telnet: connect to address fe80::1: Connection refused
      Connected to localhost.
      Escape character is '^]'.
      220 citestbox.localhost ESMTP Postfix
    • Hit Ctrl-] to get to the telnet> prompt
    • Type quit to exit

And that was it! CruiseControl.rb was now sending email from OSX, which was all I really wanted in the first place…

  1. Karl says:

    I gave up on postfix on OS X a while ago. Maybe I’ll give it a try again, just when I became accustomed to using smtp for development and sendmail for production.

  2. David James says:

    Readers may also be interested in this posting titled “10.4 Enable postfix without inducing insomnia” — intended for Tiger, not Leopard — but maybe it will be of use:

    Personally, I don’t need the postfix daemon to listen on port 25. I’m having enough trouble just sending email via sendmail. I’m getting this error: “postdrop: warning: unable to look up public/pickup: No such file or directory”. Any suggestions?

    I’m not great at Postfix; any tips on how to do some basic testing would be great — i.e. simple command line tests to see if things are working right.

  3. Chad Woolley says:


    heh i’m no expert either. As for sendmail, why do you need it? Can’t you use postfix instead?

    As for confirming postfix is working, the telnet-to-port-25 approach I mentioned in the post should work. If it is up and accepting connections, then it should “just work” to send mail.

    — Chad

  4. For others who get stuck at that point, what worked for me to add at the bottom of the dict element is:



    Looks like your xml got tidied up so it no longer worked.

    Thanks for the explanation, now it works for me.

  5. Oops, no, that’s not what I put in. The comment editor mangled that too. I’m trying one more time, and if it still doesn’t work, just know that it needs to be fixed. The second key is not a sub-element of the first key.


  6. Adam says:

    I still unable to get this working.

    My telnet localhost 25 returns, so only checking the 127 address:
    Connected to localhost.
    Escape character is ‘^]’.
    220 firefly.local ESMTP Postfix

    I’ve reloaded, restarted postfix then tested using:

    subject : test

    No email.

    I even pasted in the content from a colleague who is able to send email from the command line and it still fails.

    Any ideas?

    Small correction, the port list command you used provides the available ports not the installed ones. You are correct, you don’t have the postfix port installed =)


    Relevant sections:
    The installed option displays all installed ports.

    The list option is used to get a list of all available ports. The list of available ports is very long, so use search if you know a port’s name or part of it.

  7. Chad Woolley says:


    Hmm. Kind of suspicious that localhost doesn’t resolve for you. Do you mean you can’t ping localhost? I’d fix that first (put it in your hosts file), maybe it is related to your problem (some relevant config file is referring to localhost)…

  8. Adam says:


    Thanks for the quick reply. I was/am able to ping localhost and the telnet localhost 25 command returned sucess as you suggested, though it did not show the 2 initial Connection refused errors your listed.

    telnet localhost 25
    Connected to localhost.
    Escape character is '^]'.
    220 firefly.local ESMTP Postfix
    ping localhost
    PING localhost ( 56 data bytes
    64 bytes from icmp_seq=0 ttl=64 time=0.041 ms
    64 bytes from icmp_seq=1 ttl=64 time=0.086 ms
    64 bytes from icmp_seq=2 ttl=64 time=0.066 ms
    64 bytes from icmp_seq=3 ttl=64 time=0.083 ms

    I noticing that the mail was failing with a timeout when inspecting “mailq”. I then added authentication as per [Matt Sears post]( and it’s all working now.

    I’ve posted a few commands and links [here](

  9. huned says:

    Note that instead of rebooting, you can just use launchd to start postfix:

    $ sudo launchctl
    $ start org.postfix.start

    After you quit launchctl, telnet to localhost:25 will work.

  10. George Anderson says:

    @huned: nice, I didn’t want to reboot.

    One small typo though:

    $ sudo launchctl

    $ start org.postfix.master (not start as above)

    Thx again.


  11. Jim says:

    Some updates to an aging, but useful post:

    Matt Sears’ [gmail/postfix relay post URL]( changed, as did the URL Adam’s [useful postfix commands blog post](

    As noted above `sudo launchctl start org.postfix.master` will start it, `sudo launchctl stop org.postfix.master` will stop it, as will `sudo postfix start` and `sudo postfix stop`

    And you’ll likely want to edit /etc/postfix/ before you do any of this.

  12. Note that to see if it’s work you can use this:
    ps aux | grep postfix

    I was originally using this:
    ps -ef | grep postfix

    But it came up with nothing because postfix was running as it’s own user. After several reboots I thought it wasn’t working but it was.

    For anyone still having trouble, try Adam’s post which has more details:

    Good luck!

  13. cmholm says:

    Unfortunately, as of Oct 2009, Adam’s blog doesn’t seem to be hosted at, anymore.

    Once the org.postfix.master.plist changes are in (which I’m not sure I needed, in my case), the final step towards getting rid of the “fatal: … as _postfix” error in the mail log is to edit /etc/postfix/ so that:

    1) mail_owner = _postfix
    2) setgid_group = _postdrop

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *