What are the default special folder names for IMAP accounts in Mail.app (like Drafts, Junk, Sent)?
I'm setting up my own email server. Clients will connect to this server using IMAP.
Nowadays it's possible to map the correct 'special' folders on the server to the local client (like Drafts, Junk, and Sent). However, because the majority of the devices connecting to my server will use Mail.app (or Mail on iOS), it'd be nice if the default folder names on the server correspond to the names Mail.app uses (so I don't have to remap the folders on all devices).
Therefore, my question is: what are the special folders names Mail.app uses by default?
The Internet Engineering Task Force (IETF) defines that in a proper RFC, the RFC 6154. There you will find a list of special use mailbox denominations:
\All
This mailbox presents all messages in the user's message store.
Implementations MAY omit some messages, such as, perhaps, those
in \Trash and \Junk. When this special use is supported, it is
almost certain to represent a virtual mailbox.
\Archive
This mailbox is used to archive messages. The meaning of an
"archival" mailbox is server-dependent; typically, it will be
used to get messages out of the inbox, or otherwise keep them
out of the user's way, while still making them accessible.
\Drafts
This mailbox is used to hold draft messages -- typically,
messages that are being composed but have not yet been sent. In
some server implementations, this might be a virtual mailbox,
containing messages from other mailboxes that are marked with
the "\Draft" message flag. Alternatively, this might just be
advice that a client put drafts here.
\Flagged
This mailbox presents all messages marked in some way as
"important". When this special use is supported, it is likely
to represent a virtual mailbox collecting messages (from other
mailboxes) that are marked with the "\Flagged" message flag.
\Junk
This mailbox is where messages deemed to be junk mail are held.
Some server implementations might put messages here
automatically. Alternatively, this might just be advice to a
client-side spam filter.
\Sent
This mailbox is used to hold copies of messages that have been
sent. Some server implementations might put messages here
automatically. Alternatively, this might just be advice that a
client save sent messages here.
\Trash
This mailbox is used to hold messages that have been deleted or
marked for deletion. In some server implementations, this might
be a virtual mailbox, containing messages from other mailboxes
that are marked with the "\Deleted" message flag.
Alternatively, this might just be advice that a client that
chooses not to use the IMAP "\Deleted" model should use this as
its trash location. In server implementations that strictly
expect the IMAP "\Deleted" model, this special use is likely not
to be supported.
I created an empty IMAP account and added it to Mail.app and Notes.app on my Mac running OS X Mountain Lion. After saving some messages, all default folders were created by Mail.app. Then I connected to the IMAP server using Terminal and listed all folders:
A1 LIST "" "%"
* LIST (\HasNoChildren) "." "Sent Messages"
* LIST (\HasNoChildren) "." "Junk"
* LIST (\HasNoChildren) "." "Archive"
* LIST (\HasNoChildren) "." "Deleted Messages"
* LIST (\HasNoChildren) "." "Notes"
* LIST (\HasNoChildren) "." "Drafts"
* LIST (\HasNoChildren) "." "INBOX"
A1 OK List completed.
As you can see in the raw output, the exact default folder names are as follows:
- INBOX
- Drafts
- Sent Messages
- Junk
- Deleted Messages
- Archive
- Notes
After updating my email server to create these folder for new IMAP accounts by default, I connected a new account to my Mac. As hoped, Mail.app and Mail on iOS automatically used these special folders (I only had to enable "Store junk messages on the server" on Mac).
For those using Dovecot as well, this is the resulting configuration file with the default folders included (/etc/dovecot/conf.d/15-mailboxes.conf
):
namespace inbox {
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox "Sent Messages" {
auto = subscribe
special_use = \Sent
}
mailbox Junk {
auto = subscribe
special_use = \Junk
}
mailbox "Deleted Messages" {
auto = subscribe
special_use = \Trash
}
mailbox Archive {
auto = subscribe
special_use = \Archive
}
mailbox Notes {
auto = subscribe
}
}