Installing qmail under OS X

Intro

This document summarizes the changes needed to get qmail to compile and install under OS X/Darwin.

Assumptions

Installing qmail

  1. Download and untar qmail.

  2. Rename a couple files:
      # mv INSTALL INSTALL.txt
      # mv SENDMAIL SENDMAIL.txt
    

    This is because HFS+ is case-insensitive and there are build targets named 'install' and 'sendmail' that will clobber these text files. Not strictly needed, but I figure you might actually want to read these files later.

  3. Change a few files:

  4. Add the users/groups qmail needs. The easiest way to do this is to create a file called passwd-qmail with these contents:
      alias:*:293:293::0:0:Qmail Mail Transfer Agent:/sw/var/qmail/alias:/dev/null
      qmaild:*:294:293::0:0:Qmail Mail Transfer Agent:/sw/var/qmail:/dev/null
      qmaill:*:295:293::0:0:Qmail Mail Transfer Agent:/sw/var/qmail:/dev/null
      qmailp:*:296:293::0:0:Qmail Mail Transfer Agent:/sw/var/qmail:/dev/null
      qmailq:*:297:294::0:0:Qmail Mail Transfer Agent:/sw/var/qmail:/dev/null
      qmailr:*:298:294::0:0:Qmail Mail Transfer Agent:/sw/var/qmail:/dev/null
      qmails:*:299:294::0:0:Qmail Mail Transfer Agent:/sw/var/qmail:/dev/null
    

    And a file called group-qmail with these contents:

      nofiles:*:293:
      qmail:*:294:
    

    I borrowed these uid/gid's from the end of the range that fink reserves (see /sw/etc/{passwd,group}-fink).

    Then run these commands to add the users/groups:

      # sudo niload group . < group-qmail
      # sudo niload passwd . < passwd-qmail
    

  5. You should now be able to compile/install qmail:
      # make
      # sudo make setup check
    

  6. Proceed with step 4 and on in INSTALL.txt. I used qmail/boot/home as qmail's rc file. The other rc files should work as well though. Your milage may vary.

  7. To get qmail listening on port 25, add the following to the end of /etc/inetd.conf:
      smtp stream tcp nowait qmaild /sw/var/qmail/bin/qmail-smtpd qmail-smtpd
    

    Then send inetd a 'kill -HUP'.

Notes

I haven't tried installing daemontools / ucspi-tcp, which you can use instead of inetd if you want a little more control of qmail-smtpd. (You can use TCP ACL's, etc. Of course, you could do that with OS X's built in packet filtering too.)

Installing daemontools / ucspi-tcp should be pretty straight-forward (well, after getting qmail installed anyway). You'll probably want to put something in /System/Library/StartupItems/ to start daemontools, and let that start qmail-smtpd. But using inetd works and as you can see is pretty simple.

I got qmail running and managed to send a message (which bounced at the remote MTA, but that was okay, the bounce was delivered properly). I also got it to deliver a message to me via qmail-smtpd.

My only concern is that qmail requires UFS semantics to manage its queue (see INTERNALS). HFS+ attempts to mimic these semantics and it appears to be good enough to get qmail up and running. But I can't promise qmail won't corrupt its queue under HFS+.

It might be safer to set both of qmail/control/concurrency{local,remote} to 1. You might also want to stress test things with postal.

Personally, if I had the time, I'd re-install OS X and create a small UFS volume for the fink stuff (everything under /sw). qmail installed under UFS on OS X should be perfectly safe.

I hear postfix is actually pretty nice and appears to be fink'ified.


jay-tmda at soffian.org
Last modified: Mon Jul 8 23:36:28 PDT 2002