(Note that the build of Authlib-0.60 is completely broken. I tried working on a fix but it seems hopeless for now as all the patches are for 0.61. See the rolling back article for hints on how to do this.)
Getting Courier imapd 4.1(& authlib-0.58) to work with OS X:
First "sudo port install courier-imap" and waiting an eternity for the 1000 configures to run. Install the /opt/local/etc/LaunchDaemons/org.darwinports.courier-imap plist file using sudo launchctl.
sudo launchctl load -w /Library/LaunchDaemons/org.macports.courier-imap.plist
Give it a test - but it probably won't work due to authentication issues. System authentication doesn't seem to work at all in 4.1 with authlib 0.58 using the authpw method so userdb is needed. As well the authentication daemon is seperated and the maintainer of that package doesn't have a startup mechanism. So here are the changes I made to make it work. If there are better ways to do this I would love to know:
1) Edit to build the self-signed cert file: /opt/local/etc/courier-imap/imapd.cnf
/opt/local/sbin/mkimapcert
2)
To:
/opt/local/etc/LaunchDaemons/org.darwinports.courier-imap/courier-imap.wrapper
add
/opt/local/sbin/authdaemond start
and
/opt/local/sbin/authdaemond stop
to the obvious places. This is the seperate authentication daemon that courier imap now requires. If you don't have it - courier cannot authenticate at all.
But before we start it - we need a place for it to write its unix socket:
mkdir -p /opt/local/var/spool/authdaemon
/opt/local/etc/LaunchDaemons/org.darwinports.courier-imap/courier-imap.wrapper stop
/opt/local/etc/LaunchDaemons/org.darwinports.courier-imap/courier-imap.wrapper start
3) Edit or create: /opt/local/etc/authlib/userdb
Make user lines like this:
username uid=511|gid=511|home=/Users/username|shell=/bin/bash|systempw=*|gecos=Real Nameuse "sbin/userdbpw" to generate the hash that replaces the * for systempw. Then do a sbin/makeuserdb to convert the userdb into a DB4 database With luck it should now work! :-D If you change the system password - the latter parts of step 3 need to be repeated. Hopefully someone fixes authlib at some point to work with OS X authentication again.