How to extract text from the plain text part of multipart/alternative?
How to extract text from the plain text part of multipart/alternative? Question: # main.py import email from email.iterators import _structure import sys msg = email.message_from_string(sys.stdin.read()) _structure(msg) ./main.py <<EOF From: Nathaniel Borenstein <[email protected]> To: Ned Freed <[email protected]> Subject: Formatted text mail MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=boundary42 –boundary42 Content-Type: text/plain; charset=us-ascii …plain text version of message goes …