Moving a messageid in MessageMapper will not always create a new message id (with patch)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Steps to reproduce
- Mount a hMailServer
- With Maill App of NextCloud, delete a message
- You'll encouter an error message
Expected behavior
MessageMapper.php expects a filled array because it assumes a moved will have a different messageId, but it could be false ! Some IMAP server provide the same messageId or not provide the same messageId in case of moved message.
Actual behavior
MessageMapper.php try to get the new messageId into an empty array and crash.
Mail app version
3.4.4
Mailserver or service
hMailServer
Operating system
Linux (MailApp), Windows (hMailServer)
PHP engine version
None
Web server
None
Database
None
Additional info
Add a check into the code at line 334. The old code :
return $mapping[$messageId];
The new code :
if (empty($mapping))
return $messageId;
else
return $mapping[$messageId];
MessageMapper.zip
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
Open MessageMapper.php and inspect the message-move handling around line 334, then reproduce the deletion with a hMailServer mailbox as described. Done means the empty mapping case no longer crashes and the original message ID is returned when no new ID is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100