Motivations: ------------ I want the following features in my mail system: o I want IMAP access so I can read my mail with multiple clients. o I want standards-conforming encryption available to me so my passwords don't go over the wire in the clear. o I want my mail to get sorted into folders automatically. o I want SPAM filtering (SpamBouncer, etc.). o I want the system to be fast. I pretty much had all of these features, except for the last one, when I was running the University of Washington's IMAP server. So, I decided to migrate to courier-imapd. How to do what I did: --------------------- 0: Install procmail-3.22. I found procmail-3.15.x to have serious bugs in handling the Maildir format, so I would strongly recommend *not* using this version. 1: Get and install courier imapd. If compiling from source, and you want SSL support, you're going to have to mess around with CPPFLAGS and LDFLAGS (and have OpenSSL). While this is compiling, take a look at the graphs here: http://www.courier-mta.org/mbox-vs-maildir/ 2: Configure authentication. For now, I decided to use PAM. I had to mess around with the /usr/lib/courier-imap/etc/authdaemonrc and configure it to use PAM before LDAP -- the server was trying to use LDAP first and wouldn't let me login. 3: Make your Maildir and the folders that you want. (the server won't let you login if you don't have a Maildir either...) Before you do this, you'll probably want to read the "maildirmake" man page. You might have to muck with your MANPATH to do this. If you're impatient, here is what I did: $ /usr/lib/courier-imap/bin/maildirmake $HOME/Maildir/ $ /usr/lib/courier-imap/bin/maildirmake -f ietf-announce $HOME/Maildir $ /usr/lib/courier-imap/bin/maildirmake -f gnhlug $HOME/Maildir $ /usr/lib/courier-imap/bin/maildirmake -f gnhlug-announce $HOME/Maildir [etc.] (you can create folders through a IMAP client too) This has the effect of creating a special Maildir directory in $HOME/Maildir. Courier imapd stores folders in "dot-files" -- from the above commands a directory called $HOME/Maildir/.gnhlug is created. (*) * This has the next effect of this: when you look at your folders in a IMAP client, you'll have folders named "INBOX.gnhlug". Various people on the net suggest installing symlinks to get around this "problem", but I didn't do this. 4: Configure your .procmailrc thusly: [...lots of spurious details omitted] # I don't even know if this next line is necessary -- YMMV MAILDIR=$HOME/Maildir # Procmail delivery rules: # .../somefile -> "somefile" is in mbox format # .../foo/ -> Maildir format # .../foo/. -> MH format :0 * ^TO.*IETF-Announce@ $HOME/Maildir/.ietf-announce/ :0 * ^TO.*gnhlug@ $HOME/Maildir/.gnhlug/ # etc... # IT IS CRITICAL THAT THIS IS THE LAST RULE :0 $HOME/Maildir/ 5: Do whatever you have to do to your mail system to get it to run incoming mail through procmail. 6: Test. Test. Test. 6a: If you happen to be snarfing your mail off of another IMAP server (in my case, uwash-imapd) and putting it into this server, you might find procmail's "formail" to be useful. Alternatively, you might find fetchmail's "--folder" and "--keep" options to be useful. Caveat programmer... 7: You're running your own IMAP server -- you might want to take a moment to consider "how is my mail getting backed up?". Acknowledgements: ----------------- Obviously, I would like to thank the people who put courier-imapd, procmail, and fetchmail together -- these are industrial-strength, high-quality tools. I would also like to thank Bob Bell (GNHLUG member), Fred Yankowski, and Keith T. Garner (both of the Linux Users Of Northern Illinois) for letting me bounce ideas off them when I was running into procmail problems. THE END