Repository navigation
fix(imap): do not re-encode the path of a target mailbox - #298
Merged
robert-virkus merged 1 commit intoOct 2, 2026
Merged
robert-virkus merged 1 commit into
robert-virkus merged 1 commit into
Conversation
APPEND, COPY and MOVE passed Mailbox.encodedPath, which is already modified UTF-7, through Mailbox.encode() once more on servers without UTF8=ACCEPT. The '&' that starts every non-ASCII run became '&-', so the server rejected the command, e.g. with NO [TRYCREATE]. The encodedPath of a target Mailbox is now quoted with _quoteMailboxPath(), as SELECT and the other mailbox commands do. A plain targetMailboxPath is still encoded.
Member
|
nice one, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #297
_encodeFirstMailboxPath()passedMailbox.encodedPath, which is already modified UTF-7, throughMailbox.encode()once more on servers withoutUTF8=ACCEPT. The&that starts every non-ASCII run became&-, soappendMessage*(),copy(),uidCopy(),move()anduidMove()failed for target mailboxes with non-ASCII names or&, e.g. withNO [TRYCREATE]on Yandex.Change
_encodeFirstMailboxPath()now quotes theencodedPathof a givenMailboxwith_quoteMailboxPath(), asSELECT,STATUS,RENAME,DELETE,SUBSCRIBEandUNSUBSCRIBEalready do. A plaintargetMailboxPathis encoded as before.A
Mailboxtarget is therefore always quoted now, e.g.APPEND "INBOX"instead ofAPPEND INBOX, the same asSELECT "INBOX". Three existing expectations are updated for that.Tests
uidMove()andappendMessageText()to a mailbox from aLISTresponse no longer encode its name again. Without the fix they sendUID MOVE 1:3 &-BCMENAQwBDsEUQQ9BD0ESwQ1-andAPPEND &-BB4EQgQ,BEAEMAQyBDsENQQ9BD0ESwQ1- (\Seen) {21}.copy()with a plain non-ASCIItargetMailboxPathstill encodes it once.dart formatanddart analyzeshow no new findings,dart test: 594 passed.