IMAP socket moves by Brendan Cully, with a fix from Tommi Komulainen, and most likely based on input from Vsevolod Voykov (sp?).