AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1068014
Accepted
The Tablet
The Tablet
Asked: 2021-06-28 13:28:21 +0800 CST2021-06-28 13:28:21 +0800 CST 2021-06-28 13:28:21 +0800 CST

如何使用 Dovecot 为每个虚拟用户创建单独的邮箱配置?

  • 772

假设我有两个虚拟用户:[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
  }
}
email imap dovecot
  • 1 1 个回答
  • 221 Views

1 个回答

  • Voted
  1. Best Answer
    anx
    2021-06-30T03:52:08+08:002021-06-30T03:52:08+08:00

    禁用并移开重复的前缀,然后将这些更改从userdb.

    虽然您不能使用相同的前缀定义两个命名空间 - 如果您要覆盖via ,则不必以这种方式定义它们。userdb

    # in global configuration
    namespace primary {
      disabled = yes
      prefix = /disable-namespace
      ...
    }
    
    # in userdb: newlines for readability
    userdb_mail=maildir:/home/mail/admin
    userdb_namespace=primary
    userdb_namespace/primary/disabled=no
    userdb_namespace/primary/prefix=
    userdb_namespace/primary/inbox=yes
    

    小心list=no,它不会阻止访问。它只是从LIST输出中删除文件夹,文件夹仍然存在(因此排除了第二个具有匹配前缀的文件夹!)

    仍然可以通过显式询问来列出命名空间的文件夹。

    注意:NAMESPACE=primary在您的问题中看起来不合适,为什么在 userdb 中(但没有前缀 userdb_)?

    • 1

相关问题

  • 如何绕过 ISP 的限制性电子邮件政策?

  • SharePoint 传入电子邮件出现“未知别名”错误

  • 电子邮件帐户的角色名称与人名

  • 如何在笔记本电脑上使用 Tobit David?[关闭]

  • 随行人员通过 VPN 连接到 Exchange 2007

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve