Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IMAP batch fetch text part of messages

I'd like to download the text (that is mime type text/plain, text/html text/richtext) from UID x to UID y.

I have the UID's (and not mailbox IDs).

How can I do something like

FETCH 412444:412500 (BODY.PEEK[TEXT/PLAIN OR TEXT/HTML OR TEXT/RICHTEXT])

Thanks!

like image 759
danicgross Avatar asked Jul 03 '10 05:07

danicgross


1 Answers

After checking RFC3501, the UID command (section 6.4.8) seems to be able to do part of this:

The UID command has two forms. In the first form, it takes as its arguments a COPY, FETCH, or STORE command with arguments appropriate for the associated command. However, the numbers in the sequence set argument are unique identifiers instead of message sequence numbers. Sequence set ranges are permitted, but there is no guarantee that unique identifiers will be contiguous.

Thus, you should be able to call:

UID FETCH 412444:412500 (BODY.PEEK[TEXT/PLAIN OR TEXT/HTML OR TEXT/RICHTEXT])
like image 106
Anders Lindahl Avatar answered Nov 10 '22 07:11

Anders Lindahl