How to get emails including their attachments and how to extract various attributes from those emails. Using IMAPClient
References for deeper learning:
[1] Content-Type & Multipart: https://tools.ietf.org/html/rfc2183
[2] Open Function: https://www.w3schools.com/python/ref_func_open.asp
[3] email.Message - payload: https://docs.python.org/2/library/email.message.html#email.message.Message.get_payload
[4] More on collections: https://docs.python.org/3/library/collections.html
[5] fetch() in IMAPClient: https://media.readthedocs.org/pdf/imapclient/master/imapclient.pdf
[6] email.Message_from_bytes: https://docs.python.org/3/library/email.parser.html
Let me know if you have any questions or concerns.
Thanks!