Python IMAP Email Processing