- # A subfunction to recursively unpack the message parts into a
- # list.
- # def msg_unpacker_gen(msg):
- # if not msg.is_multipart():
- # yield msg
- # else:
- # for part in msg.get_payload():
- # for subpart in msg_unpacker_gen(part):
- # yield subpart
- #
- # return list(msg_unpacker_gen(email_msg))