Does anyone have a good example of using the HeaderParser class in Python for a message that you pull down with imaplib.fetch?
I have been able to find a lot of related things, but nothing that does just this.
Do I need to full down the fetch has an RFC822? I was hoping to simply pull down the subjects.
Thanks!
Good news: you’re right… you don’t need to pull down the RFC822. The
message_partsparameter tofetch()lets you be quite fine-grained.Here’s a simple example of how to fetch just the header:
The full list of message parts that can be passed as the second argument to
fetchis in the IMAP4 spec: https://www.rfc-editor.org/rfc/rfc1730#section-6.4.5