Set the Archive role from ihasmail, rather than describing it #221

Closed
opened 2026-09-02 15:38:21 +00:00 by jcoffey-dev · 0 comments
Owner

#220 corrected the message and left it useless. It told you a folder needs the Archive role on the server — true — and gave you nothing to do about it here, because roles were shown in Folders settings and never settable.

Confirmed live, not assumed

Mailbox/set takes role. Verified against 0.16.20, as an ordinary user through the ihasmail proxy, with no admin API: setting role: "archive" on a folder that had none returned updated, the read-back showed the role, and the folder began working as the Archive immediately. Stalwart's own source backs it — SpecialUse::parse accepts "archive", roles are unique per folder, and Inbox/Junk/Trash refuse to move theirs.

What changed

The toast carries the fix. "No Archive folder is set yet." with a Create one action that makes the folder and completes the archiving that could not happen, rather than leaving someone to select the same messages again.

A folder already named Archive with no role is adopted, not duplicated. That is the exact state #217 was reported from — right name, no role, archiving blind to it — and creating a second Archive beside the first would be its own confusion. Matched case- and whitespace-insensitively.

One named Archive that is really the Sent folder is left alone. Taking its role to fix archiving would break sending.

Folders settings gains a Role column. Archive, Drafts and Sent are offered — the roles this client's behaviour depends on and the server will move. Inbox, Junk and Trash show theirs and cannot change it, because 0.16.20 refuses outright. A role another folder already holds is left out of the list rather than offered and refused, so moving one is a deliberate two steps (clear it there, set it here) with no error to interpret.

The folder is created with the server's own name, never the localised one — the same reason renaming already writes back the server's name. A German session must not create "Archiv" that an English one cannot find.

Strings

The #220 message is retired and eight new keys take its place, in all nine catalogues. Mine, not a native speaker's, like the rest of the catalogue. i18n:check reports no new stale or missing keys.

Tests

Seven new in archive-role.test.ts — adoption, case-insensitive matching, creation with the role, the Sent-folder case, no role on an ordinary folder, the toast carrying an action, and the action completing the original archive. The existing "does nothing at all without an Archive folder" case now asserts the toast has an action instead of asserting the old wording.

npm run typecheck, npm test (904 web + 122 server), npm run build pass.

Merged 2026-09-02 as coffey-labs/ihasmail@f1a8f162cf

Rebuilt from: git history, session transcript.

#220 corrected the message and left it useless. It told you a folder needs the Archive role *on the server* — true — and gave you nothing to do about it here, because roles were shown in Folders settings and never settable. ## Confirmed live, not assumed `Mailbox/set` takes `role`. Verified against **0.16.20**, as an ordinary user through the ihasmail proxy, with no admin API: setting `role: "archive"` on a folder that had none returned `updated`, the read-back showed the role, and the folder began working as the Archive immediately. Stalwart's own source backs it — `SpecialUse::parse` accepts `"archive"`, roles are unique per folder, and Inbox/Junk/Trash refuse to move theirs. ## What changed **The toast carries the fix.** "No Archive folder is set yet." with a **Create one** action that makes the folder *and completes the archiving that could not happen*, rather than leaving someone to select the same messages again. **A folder already named Archive with no role is adopted, not duplicated.** That is the exact state #217 was reported from — right name, no role, archiving blind to it — and creating a second Archive beside the first would be its own confusion. Matched case- and whitespace-insensitively. **One named Archive that is really the Sent folder is left alone.** Taking its role to fix archiving would break sending. **Folders settings gains a Role column.** Archive, Drafts and Sent are offered — the roles this client's behaviour depends on and the server will move. Inbox, Junk and Trash show theirs and cannot change it, because 0.16.20 refuses outright. A role another folder already holds is left *out of the list* rather than offered and refused, so moving one is a deliberate two steps (clear it there, set it here) with no error to interpret. **The folder is created with the server's own name**, never the localised one — the same reason renaming already writes back the server's name. A German session must not create "Archiv" that an English one cannot find. ## Strings The #220 message is retired and eight new keys take its place, in all nine catalogues. Mine, not a native speaker's, like the rest of the catalogue. `i18n:check` reports no new stale or missing keys. ## Tests Seven new in `archive-role.test.ts` — adoption, case-insensitive matching, creation with the role, the Sent-folder case, no role on an ordinary folder, the toast carrying an action, and the action completing the original archive. The existing "does nothing at all without an Archive folder" case now asserts the toast has an action instead of asserting the old wording. `npm run typecheck`, `npm test` (904 web + 122 server), `npm run build` pass. **Merged** 2026-09-02 as coffey-labs/ihasmail@f1a8f162cfcd <sub>Rebuilt from: git history, session transcript.</sub>
This repo is archived. You cannot comment on issues.