I generally feel like this kind of code (extensions to the base imapd.js thing should live in its own file)