FETCH BODY vs FETCH BODYSTRUCTURE + FETCH BODY.PEEK
Alessio Cecchi
alessio at skye.it
Thu Nov 15 11:57:19 EET 2018
Hello,
we are developing a web page, for a ticket system, to show the email
messages ordered by the biggest attachments size present in an IMAP
folder, with a pagination of 100 messages per page. Each raw represents
a message with "DATE, FROM, SUBJECT, the preview (the first 500 chars of
the text/html of the messsage) and the list of the attachments (name +
size) it contains.
The problem is that the page load is VERY slow because we fetch the
entire BODY of all 100 messages, in order to get the preview and the
attachments name and size.
Now, considering that each messages can contain up to 50 MB of
attachments, we risk to download 5000MB from IMAP for every page.
An option might be to perform two FETCH for each message:
- one fetch with just the BODYSTRUCTURE (where we can get the
attachments name and size and the text/html parts).
- one fetch with the body parts (BODY.PEEK[]) we need to build the
preview (text + html).
We are wondering if there is a single FETCH command to get the text and
html parts (needed to build the preview) with only the name and the size
of the attachments without downloading the entire message.
Thanks.
--
Alessio Cecchi
Postmaster @ http://www.qboxmail.it
https://www.linkedin.com/in/alessice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dovecot.org/pipermail/dovecot/attachments/20181115/eb3a2cf4/attachment.html>
More information about the dovecot
mailing list