- Implemented parse_email_body function for RFC822 email parsing - Uses stdlib email.message_from_bytes with modern EmailMessage API - Extracts text and HTML bodies using get_body() method - Prefers plain text over HTML for "preferred" field - Converts HTML to text using html2text when text body missing - Extracts all metadata: subject, from, to, date, message_id - Uses parsedate_to_datetime for proper date parsing - Handles UnicodeDecodeError gracefully with partial data return - Follows async patterns and logging conventions from existing codebase
4.2 KiB
4.2 KiB