-
Hi All, I am new to IMAP and this may not be a imapclient specific question. I was wondering if there is a way to skip fetching attachments? I know passing 'ENVELOPE' ( I am trying to fetch my entire mailbox to perform some analytics, it runs into a couple of gigabytes if I fetch along with attachments, and they are of no use to me. any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is completely possible by fetching the Relevant parts of IMAP RFC: |
Beta Was this translation helpful? Give feedback.
This is completely possible by fetching the
BODYSTRUCTURE
for each message. This provides details for each part of the email, including the content type for each. Using this you can figure out the parts you're interested in (i.e. the text/plain or text/html parts), compute the part number(s) of interest and then fetchBODY.PEEK[<part number>]
to retrieve it.Relevant parts of IMAP RFC: