-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I force local parsing on IMAP Connections? #733
Comments
The IMAP session properties are in the Angus Mail project. Try setting session property |
Hey! For some reason I could not see your comment until now, dunno how I managed to do that. I will try this suggestion out today and report, thank you for pointing me in this direction! |
@jmehrens ok I tried out your suggestion but it seems it only determines if it downloads the entire bodypart in one go or in chunks. However, even with partialfetch = false, it is still handling the message parts individually by calling BODYSTRUCTURE and FETCH for individual parts of the message, as opposed to fetching the entire MIME in one go.
It is this way of essentially handing the MIME Parsing to the server (by asking for body parts via the protocol) that allows Exchange to botch the BODYSTRUCTURE response and cut of the file name because Exchange doesn't handle RFC-2251 properly |
I opened a new issue at the correct Project: eclipse-ee4j/angus-mail#150 |
Describe the bug
We are trying to access a local-run Microsoft Exchange Server via IMAP. This leads us to retrieving attachments of incoming mails with cut-off filenames. After enabling Debug logging we can see that jakarta mail is not downloading the entire MIME structure of the e-mail but is utilizing IMAP to fetch information about attachments via the BODYSTRUCTURE call. Apparently, Exchange is too stupid to support RFC-2251 properly, which allows long fields to be split into multiple lines, and favors to return a cut-off filename instead. This was proven with the logs, the response to the BODYSTRUCTURE call contained the clipped filename (parts of the extension were missing due to them being in the next line inside the MIME structure)
Since we know that jakarta mail also supports POP3, and POP3 expects the mail to be parsed locally, is there a way to alter its behavior on IMAP connections to be the same? Our usecase mandates that we are downloading the entire mail including attachments anyways, so parsing MIME locally would both circumvent the idiocy of Exchange and not come at mentionable cost to us transmission-wise.
To Reproduce
Steps to reproduce the behavior:
Not really reproducible, this occurs on a customer system with some local Microsoft Exchange server of which operations are even outsourced to a sub-contractor...
Expected behavior
Jakarta Mail should ignore the fact that we are talking IMAP and request a download of the entire MIME structure for local parsing as it would do for POP3, instead of using IMAP commands for server-side parsing.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Unknown/Irrelevant
Mail server:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: