Describe the bug
For Gmail accounts whose system folders use the [Google Mail]/ prefix (accounts created in the UK and Germany, where Gmail used to be branded “Google Mail”), Mailspring shows the full IMAP path instead of a clean name:
[Google Mail]/Sent Mail[Google Mail]/All Mail[Google Mail]/Spam[Google Mail]/Bin
The same folders on a [Gmail]/ account display as “Sent Mail”, “All Mail”, “Spam”, “Bin”.
It’s worse with more than one account. In the All Accounts section, the combined Sent folder takes its label from the Gmail account, so it shows as “[Google Mail]/Sent Mail” even though it contains sent mail from every account. It looks like a Gmail-only folder, and the other accounts’ Sent folders seem to be missing. (Their system folders aren’t listed under their own account headings either, so they’re hard to find.)
Cause
The displayName getter on the Category model only strips a fixed list of prefixes:
for (const prefix of ['INBOX', '[Gmail]', '[Mailspring]']) {
if (decoded.startsWith(prefix) && decoded.length > prefix.length + 1) {
return decoded.substr(prefix.length + 1);
}
}
[Google Mail] isn’t in the list.
Suggested fix
Add '[Google Mail]' to the prefix list:
for (const prefix of ['INBOX', '[Gmail]', '[Google Mail]', '[Mailspring]']) {
It might also be worth labelling unified sidebar items from the folder role (for example the existing localized “Sent” / “Spam” / “Trash” names), rather than from the first account’s folder path, so a combined folder never looks like it belongs to one account.
To reproduce
- Add a Gmail account whose folders are under
[Google Mail]/(a UK Gmail account, for example). - Add a second account (any IMAP account).
- Look at the All Accounts section of the sidebar.
Expected: “Sent Mail” (or “Sent”), “All Mail”, “Spam”, “Bin”.
Actual: “[Google Mail]/Sent Mail”, “[Google Mail]/All Mail”, “[Google Mail]/Spam”, “[Google Mail]/Bin”.
Environment
- Mailspring 1.26.2
- Windows 11
- Accounts: Gmail (
[Google Mail]/folders) + generic IMAP (INBOX.-prefixed folders)