For demo purposes I needed a mail + IMAP server on my laptop. IMAP because there seems to be no way for Thunderbird to read from an mbox file (shocking!). Postfix comes default with OS X, so that was a no brainer.
However getting IMAP to work took some work. I’m detailing the steps here.
- Get IMAP source code from http://www.washington.edu/imap/ and untar somewhere. (I’m assuming you have full XCode development environment setup. If not, dig out your Install DVD and do so)
- Edit the top level MAKEFILE and comment out this line:
Make sure the next line (which is
SPECIALS=is not commented out)
- Copy generated
- Since 10.6 has no xinetd anymore, I had to write a launchd plist file. Create this file as
<?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>Disabled</key> <false/> <key>Label</key> <string>com.uwimap.imap</string> <key>ProgramArguments</key> <array> <string>/usr/local/bin/imapd</string> </array> <key>inetdCompatibility</key> <dict> <key>Wait</key> <false/> </dict> <key>InitGroups</key> <true/> <key>Sockets</key> <dict> <key>Listeners</key> <dict> <key>SockServiceName</key> <string>imap</string> </dict> </dict> </dict> </plist>
The file should be owned by user root and group wheel.
- Configure PAM support. I did this by this kludge:
sudo cp /etc/pam.d/ftpd /etc/pam.d/imap
- Ask launchd to load and start this service:
sudo launchctl load /Library/LaunchDaemons/com.uwimap.imap.plist sudo launchctl start com.uwimap.imap
- Try telnetting to localhost 143 and 993 to see if imap is up
This should create a functioning IMAP server. YMMV