假设我有两个虚拟用户:[email protected]
和[email protected]
.
我希望邮箱bugs
配置如下...:
mailbox Sent {
special_use = \Sent
}
mailbox Drafts {
special_use = \Drafts
}
mailbox "Priority 1" {
auto = subscribe
}
mailbox "Priority 2" {
auto = subscribe
}
mailbox "Priority 3" {
auto = subscribe
}
mailbox Unreplied {
auto = subscribe
}
mailbox Resolved {
auto = subscribe
}
...但是邮箱admin
配置了一些不同的文件夹:
mailbox Sent {
special_use = \Sent
}
mailbox Drafts {
special_use = \Drafts
}
mailbox System {
auto = subscribe
}
mailbox DMARC {
auto = subscribe
}
mailbox Archives {
auto = create
special_use = \Archive
}
mailbox Trash {
special_use = \Trash
}
mailbox Spam {
auto = create
special_use = \Junk
}
我不希望将电子邮件的文件夹bugs
复制到admin
电子邮件中,反之亦然。
我尝试的是使用命名空间,然后通过我的 passwd 文件设置每个虚拟用户的收件箱命名空间名称,如下所示:
admin:<password>::::::userdb_mail=maildir:/home/mail/admin NAMESPACE=primary userdb_namespace/primary/inbox=yes userdb_namespace/primary/list=yes userdb_namespace/primary/prefix=primary/
bugs:<password>::::::userdb_mail=maildir:/home/mail/bugs NAMESPACE=bugs userdb_namespace/bugs/inbox=yes userdb_namespace/bugs/list=yes userdb_namespace/bugs/prefix=bugs/
但 Dovecot 的日志说:
namespace configuration error: Duplicate namespace prefix: "" in=0 out=408 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
我的完整15-mailboxes.conf
:
namespace bugs {
list = no
type = private
mailbox Sent {
special_use = \Sent
}
mailbox Drafts {
special_use = \Drafts
}
mailbox "Priority 1" {
auto = subscribe
}
mailbox "Priority 2" {
auto = subscribe
}
mailbox "Priority 3" {
auto = subscribe
}
mailbox Unreplied {
auto = subscribe
}
mailbox Resolved {
auto = subscribe
}
}
namespace primary {
list = no
type = private
mailbox Sent {
special_use = \Sent
}
mailbox Drafts {
special_use = \Drafts
}
mailbox System {
auto = subscribe
}
mailbox DMARC {
auto = subscribe
}
mailbox Archives {
auto = create
special_use = \Archive
}
mailbox Trash {
special_use = \Trash
}
mailbox Spam {
auto = create
special_use = \Junk
}
}
禁用并移开重复的前缀,然后将这些更改从
userdb
.虽然您不能使用相同的前缀定义两个命名空间 - 如果您要覆盖via ,则不必以这种方式定义它们。
userdb
小心
list=no
,它不会阻止访问。它只是从LIST
输出中删除文件夹,文件夹仍然存在(因此排除了第二个具有匹配前缀的文件夹!)注意:
NAMESPACE=primary
在您的问题中看起来不合适,为什么在 userdb 中(但没有前缀 userdb_)?