What is a namespace? A namespace is a hierarchical list of mailboxes a user has access to, named to maintain uniqueness and provide access control.
There are four different uses of the term “namespace” within Cyrus:
IMAP NAMESPACE command
This is the set of mailboxes a user has access to and is the namespace as defined by RFC 2342 in response to the
A user can have access to three different kinds of mailboxes: their own (known as personal), other people’s mailboxes that they have shared access to (known as other users) and any mailboxes that have more than one owner (known as shared).
More info at User Access Namespaces.
User namespace mode: altnamespace
Cyrus’s user namespace mode controls how it responds to the
IMAP NAMESPACEcommand and what the heirarchy of mailboxes looks like in response to an
IMAP LISTcommand for a user. The config setting altnamespace: on or off in imapd.conf(5) manages the mode. It is also affected by the hierarchy separator, which can be “/” (default: on) or ”.” (off) controlled by unixhierarchysep in imapd.conf(5).
altnamespace: on (default)
altnamespace: off (was known as standard or regular)
- personal: INBOX
- other users: user
- shared: “” (empty string)
altnamespace mode is valid only for the user namespace: it doesn’t affect the administrator’s view.
Consider a user “uhura”. Uhura can see all the folders from user “spock”, some folders from users “kirk”, as well as the shared folder “commandcrew”.
Under altnamespace:off mode with a
.separator, she sees her folders as:
- INBOX.folder-2 (etc)
- user.spock (this is INBOX for “spock”)
- user.kirk.folder-y (“kirk” hasn’t shared their INBOX)
Under altnamespace:on mode with a
/separator, she sees her folders as:
- INBOX (INBOX is special in IMAP and is always the users Inbox)
- folder-2 (etc)
- Other Users/spock
- Other Users/spock/folder-x
- Other Users/kirk/folder-y
- Shared Folders/commandcrew
When using a
.separator (unixhierarchysep: off), user names and folder names internally swap the
^. This is because dots mark a subfolder if you’re not using unixhierarchy separators. Some IMAP clients do not cope well with the ^ character, which is why unixhierarchysep: on is now the default as it allows dots in usernames and folder names.
More info at User Namespace Mode.
While a user has their three kinds of mailboxes they have access to, an administrator can see all mailboxes (optionally restricted to the administrator’s own domain). As a result, the response to
LISTcommands is different for administrators.
In the administrator namespace, all user mailboxes are presented as
user/<username>/<folder>(with unixhierarchysep: on) and with
@<domain>appended in virtual domain mode. Shared folders appear at the top level. The user namespace mode (altnamespace on/off) does NOT affect administrator mode; only the hierarchy separator affects display.
For unixhierarchy separators:
More info at Administrator Namespaces.
Developer reference only. This is how each mailbox is uniquely stored inside
mailboxes.db. Each mailbox name has a unique representation that is the “key” in the mailboxes.db key-value database.
- commandcrew (??)
More info at Namespaces: a developer view.
User Access Namespaces¶
The personal namespace refers to the hierarchy of mailboxes that a
Cyrus IMAP user owns, such as user Nyota Uhura <firstname.lastname@example.org>
being the owner of the
Mailboxes in the personal namespace start with the literal string
Uhura will typically view her personal namespace such that sub-folders of
her INBOX may not have a distinguished prefix – other than perhaps
altnamespace is disabled:
INBOX Drafts Sent Items Spam Trash
Other Users Namespace¶
The Other Users namespace is a namespace that is reserved for mailboxes in other user’s personal namespaces, that have been shared with the current user.
With Spock and Kirk in the same environment, who are also sharing their personal mailboxes with Uhura, the Other Users Namespace namespace kicks in when these mailboxes are viewed.
For Nyota Uhura <email@example.com>, with James Kirk <firstname.lastname@example.org> sharing a selection of his mailboxes, Uhura’s mailbox list looks like:
INBOX Drafts Sent Items Spam Trash Other Users/james.kirk Other Users/james.kirk/Subfolder
Note that the prefix used here is “Other Users” to show the mailbox in question is part of another user’s personal namespace.
The other users namespace can be suppressed in LIST commands by setting
1 in imapd.conf(5). This
is useful in larger environments because of the nature of the
Discretionary Access Control Cyrus IMAP
entertains by default.
User Namespace Mode¶
altnamespace: on or off¶
If you are upgrading an existing server which uses timsieved(8) to manage Sieve scripts and choose to swap namespace modes, you should run the script translatesieve(8) after configuring the namespace option(s). This script will translate the folder names in fileinto actions.
By default Cyrus IMAP uses altnamespace: on , and unixhierarchysep: on “/” (slash) character for the hierarchy separator.
The following limits also apply:
- Mailbox names are case-sensitive,
- A mailbox name may not start with a
- A mailbox name may not contain two
.(dot) characters in a row,
- Non-ASCII characters and shell meta-characters are not permitted in mailbox names.
While these limits apply under all circumstances, use of the unix hierarchy separator can also affect the display.
When using the altnamespace:off namespace mode, a user’s
shorthand qualifier (e.g.
email@example.com) MAY NOT
. (dot) character, as the character is being used as a
hierarchy separator in mailbox names, and would thus create a personal
mailbox rather then a user’s INBOX. Using
the INBOX name for user John Doe <firstname.lastname@example.org> does not work,
as it would create a sub-folder
doe for the INBOX
The same limitation goes for the use of virtual domains. Since a mailbox
in a virtual domain typically uses a fully qualified user identifier
email@example.com, thus including a valid (sub-)domain name),
. (dot) character is inherited from the Domain Name System
naming convention. This poses a problem without the use of the
(dot) character as a mailbox hierarchy separator.
In a default situation using the altnamespace:on namespace
mode, a user John Doe <firstname.lastname@example.org> would start out with a
INBOX, and will want to create sub-folders such as
for drafted and sent messages.
These mailboxes will be presented to John’s client as follows (assuming dot separator):
Where altnamespace is set to off, this looks like:
altnamespace in an active operating environment will
cause all IMAP clients to need to resync the entire hierarchy.
An administrator – a user for which the username is included in the
admins setting in imapd.conf(5) – has a different
perspective when using the IMAP protocol to perform administrative
The administrator namespace is not affected by the user namespace mode (altnamespace: on/off)
With the UNIX hierarchy separator enabled, the list would look as follows:
Continuing with the UNIX hierarchy separator enabled, should virtual
domains be in use, the list may appear to the administrator user
cyrus as follows:
admins setting in imapd.conf(5) allows for a
email@example.com to be specified as an administrator as
firstname.lastname@example.org take a peek, then the following list
In multi-domain or multi-tenant environments, the following mailboxes may exist:
Be aware that an unrealmed
cyrus administrator user
can administrator mailboxes in each of the three realms (null for
email@example.com), but a realmed
firstname.lastname@example.org will be able to see and administer
mailboxes restricted to the
example.org authorization realm.
In this case they will see
being presented as
user/john – not to be confused with the
user/john mailbox that exists on the system