Notes about reading messages with the Python email packages
Summary
Chris Siebenmann discusses practical experiences reading and parsing MIME messages with Python's email package across Python 2 and Python 3. The post covers the nuances of EmailMessage vs Message, when to rely on get_content() vs get_payload(), and common pitfalls with malformed messages and typing. It also shares tips for type checking with mypy and how to handle complex header/content extraction in real-world mail data.