under Settings > Email > Defaults, you can configure default folders with aliases.
(Email | Stalwart).
Can I also set aliases for already existing accounts?
The following scenario: I have a folder for sent messages named “Sent Items” with the Sent role assigned. Thunderbird correctly uses this folder for sent messages, but iOS Mail does not. Instead, it always creates a new folder called “Sent”.
Using Stalwart Version v0.16.11 Docker with Postgres as Database, Store..
Thanks in advance,
Dominik
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
Let me look into how mailbox aliases work in Stalwart, particularly for existing accounts.
The aliases field in defaultFolders is a global server-wide setting that applies when new accounts are created – it is not something you can configure per-mailbox on an existing account through the server settings UI.
However, the good news for your iOS Mail problem: the aliases field in defaultFolders tells Stalwart to recognise additional names as pointing to the same special-use folder. So if you add "Sent" as an alias for your sent folder (which is named “Sent Items”), the server will treat any folder iOS Mail creates named “Sent” as the same folder – or at least redirect writes to the correct one.
You can update the global defaultFolders setting in the WebUI under Settings > Email > Defaults, or via the JMAP API / CLI. The relevant JSON would look like this:
Important caveat:defaultFolders (including its aliases) is described in the docs as applying to new accounts. Whether updating it retroactively affects already-existing accounts’ folder alias resolution is not explicitly documented. For existing accounts that already have a “Sent Items” folder, adding the alias globally is worth trying, but the docs do not confirm that it back-fills existing mailboxes. A human community member may be able to clarify whether existing accounts pick up the alias change immediately.
I configured the alias right after the initial Stalwart setup. However, I had already created my account before applying those configuration changes, so I’m wondering if that’s why it didn’t take effect.
Default folders are applied when an account’s mailboxes are first provisioned, so changing the server default afterwards doesn’t rewrite folders on accounts that already exist, which is exactly what you suspected. For the existing account the mapping has to apply to that account’s mailbox set rather than only the global default.
Can the mailbox mapping be applied to an existing account afterwards? Or am I misunderstanding how aliases are supposed to work?
The reason I’m asking is my iOS Mail issue: I already have a mailbox named ‘Sent Items’, but iOS Mail always(*) expects a folder named ‘Sent’ and creates it if it doesn’t exist.
My expectation was that, by adding ‘Sent’ as an alias for ‘Sent Items’, the server would recognize both names and store sent messages in the existing ‘Sent Items’ mailbox instead of creating a new one.
Two different things are in play here. Default-folder names are only applied when an account is first created, so changing them later won’t rename an existing “Sent Items”. But default-folder aliases are consulted live when a client lists mailboxes, independent of when the account was provisioned. So adding “Sent” as an alias on the Sent-role default folder should make iOS’s “Sent” resolve to your existing “Sent Items” rather than creating a duplicate, as long as “Sent Items” actually carries the Sent special-use role.
Worth trying on your existing account: confirm “Sent Items” has the Sent role, add “Sent” to that default folder’s aliases under Settings > Email > Defaults, then have iOS re-list folders. If iOS still creates a duplicate after that, the next thing to check is whether it’s selecting folders by special-use rather than by name, and we can go from there.
I confirmed everything again and didn’t change any settings since aliases were already set up. Unfortunately, I can no longer reproduce the issue. Sending an email now puts it in the correct folder/mailbox. Maybe it’s worth mentioning that I’ve updated to version 0.16.12. Thanks for your help, I think we are done for now.