Rework message body decoding
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
We got some reports about broken preview texts:
https://github.com/nextcloud/mail/issues/7408
https://github.com/nextcloud/mail/issues/7497#issuecomment-1311073366
https://github.com/nextcloud/mail/issues/7687
After https://github.com/nextcloud/mail/pull/7709 the preview text should work. The only downside is that the decoding is done in Nextcloud Mail although the IMAP server could do it.
@miaulalala discovered that decode = true don't work when the IMAP server does not support the binary extension.^1
The inaccuracy within our current code is to use content-transfer-encoding to decode the message. content-transfer-encoding stays the same regardless if the IMAP server is requested to decode a message or not.
To use server-side decoding, we need to know if the message body was decoded by the IMAP server: Horde_Imap_Client_Data_Fetch.getBodyPartDecode.^3
Todo: Rework the existing code to use server-side decoding.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/IMAP/MessageMapper.php around lines 705-708 and review the referenced Horde examples for getBodyPartDecode. Trace the existing preview decoding and verify behavior with and without IMAP binary-extension support. Done means server-side decoding is used correctly and preview text remains accurate for the reported cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100