messenger.accounts.list() might fail if some folder name contains '%'-sign
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(Not tracked)
People
(Reporter: G.Gersdorf, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
Steps to reproduce:
Find an imap server which allows to create folders with '%'-sign in the name (not all imap server allows this)
Create a folder name 'abc% def' (the imap server i've used for tests allows this but not 'abc%def')
Open a debugger window for an arbitrary add-on
Enter 'await messenger.accounts.list();'
Actual results:
malformed URI sequence ext-mail.js:1473
Uncaught (in promise) Error: An unexpected error occurred
Expected results:
Should return a list of accounts.
ext-mail.js:1473 is the function
function folderURIToPath(uri) {
let path = Services.io.newURI(uri).filePath;
return path
.split("/")
.map(decodeURIComponent) <--
.join("/");
}
which is called when the subfolders of an account are traversed.
This function is called with a 'folder.URI', which (in my test) returns
"imap://name@imap.web.de/abc% def"
decodeURIComponent throws the error if it tries to decode this because of the %-sign
(folder.folderURL returns imap://name@imap.web.de/abc%25%20def)
This problem does not happens with folders in the 'local folders' account. In this case folder.URI returns mailbox://nobody@Local%20Folders/abc%25%20def
Comment 1•5 years ago
|
||
Just to note: "Crash" normally refers to a crash of the application or process, not an error thrown in response to bad input.
Comment 2•4 years ago
|
||
Apparently + is also causing issues:
https://thunderbird.topicbox.com/groups/addons/T5dee8bb7bbf0b70a-Mcc1d5256b099bc18ff9994dd
Updated•4 years ago
|
Description
•