split out imap and smtp code into separate layers so composite/account loads faster