Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IMAP fetch of a mime part without fetching the whole message

Tags:

imap

I need some help formulating an IMAP fetch command to only fetch a certain mime attachment without fetching the whole body or other attachment. Given the following bodystructure

(BODYSTRUCTURE (("text" "html" ("charset" "utf-8") NIL NIL "base64" 568 8 NIL NIL NIL) "mixed" ("boundary" "===============0621936444==") NIL NIL))

how would a fetch command for fetching the text/html part look like? I have read Section 6.4.5 of RFC3501 several times but I still don't get it. Any pointers to further examples of fetch requests for mime attachments would also be appreciated.

like image 1000
pysnake Avatar asked Jan 21 '26 01:01

pysnake


2 Answers

Off the top of my head it would be something like:

FETCH 88 BODY.PEEK[1]

where 88 is the 88th message, and 1 is the body part.

like image 61
dave wanta Avatar answered Jan 26 '26 00:01

dave wanta


Try this one:

FETCH uid BODY.PEEK[1.2]
like image 41
jack-london Avatar answered Jan 25 '26 22:01

jack-london



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!