This is filed under LBBS for mod_webmail, but this applies equally to evergreen as well.
The current mechanism for extracting the plaintext/HTML message component is to parse the body manually and look at the content types. Instead, we should be able to make use of the BODYSTRUCTURE
command in IMAP to do this more efficiently, also minimizing unnecessary content downloads. This can also be used for parsing attachments out and sending those to the frontend.
Informative Reference: https://en.wikipedia.org/wiki/MIME#Multipart_messages
You must be