IMAP: cleanup and fix bodystructure