Kyle’s Reference Links

Contents External Links Friendly Links Marvin Links

Installing qmail on MacOS X 10.3 (Panther)

This is surprisingly challenging, in part because HFS+ isn't case sensitive (only case-preserving), in part because things that are not guaranteed (like initial values of uninitialized variables) are REALLY not guaranteed, and in part because the compiler and linker take slightly different arguments. As such, there are many attempts to make qmail work nicely on MacOS X, and not all of them work or are entirely sufficient. This is a list of the things that I did to get qmail working on my system. I make no guarantees, but this worked. I should note that I am using 10.2.6. Note: I was recently pointed to another set of install instructions, that are very good, here.

Before Installation

One of the better guides out there has a great step-by-step walk through here, but it didn't fully handle all problems for me. Here's what I did (much of this is on the soffian link, but there are some changes):
  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:
    • Edit conf-ld and change 'cc -s' to 'cc -Xlinker -x'
    • Edit conf-qmail and change '/var/qmail' to '/sw/var/qmail' (this is not necessary)
    • Edit make-makelib.sh and just below 'sco*) ;;' add this:
      darwin-*)
      	echo 'ranlib -c "$main"'
      	;;
      This ranlib trick is from here
    • Change line 4 of strerr_sys.c to read:
      struct strerr strerr_sys = {0,0,0,0};
    • Change line 81 of hier.c to read:
      c(auto_qmail,"doc","INSTALL.txt",auto_uido,auto_gidq,0644);
  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 also create a file called group-qmail with these contents:
    nofiles:*:293:
    qmail:*:294:
    These uid/gid's are borrowed 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 as per the instructions in Life with Qmail

After Installation

There are a few ways to get qmail to run. Without any additional software (THIS IS BAD!) you can just run qmail with the inetd that comes with MacOS X, by adding the following line to the end of /etc/inetd.conf and then sending inetd a HUP by running killall -HUP inetd:
smtp stream tcp nowait qmaild /sw/var/qmail/bin/qmail-smtpd qmail-smtpd
The better/correct way to run qmail is (as Life with Qmail says) by using daemontools. A handy way to make daemontools and svscanboot running at startup is to use the StartupItem available here.
Valid XHTML 1.0 Strict! Valid CSS! Lovingly handcrafted with Vim