in reply to IMAP & IMAPS module?

As you only need the authentication part(s) of the IMAP-modules, wouldn't it be better if you provide it yourself in your module, rather than loading another module of which probably 90% of the code is irrelevant for you? Especially if this other module is buggy and not being actively maintained?

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James