介紹
IMAP extension (RFC 2342)
功能:
hints about where to locate mailboxes and whether they're private, shared or public.
- Changing the hierarchy separator
- Provides support for public and shared mailboxes
- mails in multiple different locations with possibly different formats
Dovecot creates a private namespace automatically. This automatic namespace creation isn't done when namespaces are defined
IMAP clients, Sieve scripts and many parts of Dovecot configuration use the configured separator when referring to mailboxes.
一共只有 3 種 namespaces:
- private: Typically contains only user's own private mailboxes.
- shared: Contains other users' shared mailboxes
- public: Contains public mailboxes.
Default devocot 是沒有 Namespace 的 prefix 的 !
- Courier you probably had this set to "INBOX."
- UW-IMAP you might have set it to "mail/".
Courier IMAP
You can continue using the same INBOX. namespace as Courier:
namespace private { separator = . <--- UpFolder.DownFolder prefix = INBOX. inbox = yes }
- Namespace with prefix="", separator=. (Maildir default): Work.Customers
- Namespace with prefix=INBOX., separator=. (Courier migration): INBOX.Work.Customers
- Namespace with prefix="", separator=/ (mbox, dbox default): Work/Customers
設定的 Options
separator
Maildir++ 的 default separator 是 '.'
它與 File System 的目錄結構完全無關, 只是一種表現方式
hidden
hidden: "yes", if this namespace shouldn't be listed in NAMESPACE reply.
inbox
inbox: "yes", if this namespace contains the user's INBOX. There is only one INBOX, so only one namespace can have inbox=yes.
location
default: 在 dovecot 內的 mail_location 設定
location: Mailbox location
list
default: yes <== listed by LIST command when the namespace prefix isn't explicitly specified as a parameter
value: children <== 是當有子項目才顯示
subscriptions
default: yes
Example1:
A server that supports a single personal namespace.
No leading prefix is used on personal mailboxes and
"/" is the hierarchy delimiter.
# telnet 測試
Client: A001 NAMESPACE
Server: * NAMESPACE (("" "/")) NIL NIL
Server: A001 OK NAMESPACE command completed
Example2:
# A server that contains a Personal Namespace and a single Shared Namespace.
C: A001 NAMESPACE
S: * NAMESPACE (("" "/")) NIL (("Public Folders/" "/"))
S: A001 OK NAMESPACE command completed
Examle3:
# 查看某人的 share
C: A001 NAMESPACE
S: * NAMESPACE (("" "/")) (("#Users/" "/")) NIL
S: A001 OK NAMESPACE command completed
C: A002 LIST "" "#Users/%"
S: A002 NO The requested item could not be found.
C: A003 LIST "" "#Users/Mike/%"
S: * LIST () "/" "#Users/Mike/INBOX"
S: * LIST () "/" "#Users/Mike/Foo"
S: A003 OK LIST command completed.
Courier IMAP telnet test
private folder:
... 0 LIST "" "*" * LIST (\Unmarked \HasChildren) "." "INBOX" * LIST (\HasChildren) "." "INBOX.Sent" * LIST (\HasNoChildren) "." "INBOX.Drafts" ... 0 OK LIST completed
shared folder:
... 0 LIST "" "#shared.*" * LIST (\HasNoChildren) "." "#shared.postmaster.Calendar" * LIST (\Noselect \HasChildren) "." "#shared.postmaster" 0 OK LIST completed
連 shared folder
namespace { list = children location = maildir:%%Lh/Maildir:INDEX=%Lh/Maildir/shared/%%Lu prefix = shared.%%u. separator = . subscriptions = no type = shared hidden = no }
DOC
http://wiki2.dovecot.org/Namespaces