Patches for email delivery plugin (smtp send and imap receive) [sf#1342716] [#544]