ERROR: Connection dropped by IMAP server

Just ran into a few issues with Courier-imap on lenny, and it appears I am not alone:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=379806

this is probably more accurate

The problem in the end was the IMAP_MAILBOX_SANITY_CHECK option.