![使用 lmtp 和 vmail 用户的 dovecot 配置 - 直接在 Maildir 中创建 INBOX,缺少垃圾邮件、废纸篓等文件夹](https://linux22.com/image/1623450/%E4%BD%BF%E7%94%A8%20lmtp%20%E5%92%8C%20vmail%20%E7%94%A8%E6%88%B7%E7%9A%84%20dovecot%20%E9%85%8D%E7%BD%AE%20-%20%E7%9B%B4%E6%8E%A5%E5%9C%A8%20Maildir%20%E4%B8%AD%E5%88%9B%E5%BB%BA%20INBOX%EF%BC%8C%E7%BC%BA%E5%B0%91%E5%9E%83%E5%9C%BE%E9%82%AE%E4%BB%B6%E3%80%81%E5%BA%9F%E7%BA%B8%E7%AF%93%E7%AD%89%E6%96%87%E4%BB%B6%E5%A4%B9.png)
这是我的dovecot.conf
(我没有conf.d
)。
listen = *
ssl = required
ssl_cert = </etc/letsencrypt/live/domain.tld/fullchain.pem
ssl_key = </etc/letsencrypt/live/domain.tld/privkey.pem
ssl_dh = </etc/dovecot/dh.pem
mail_location = maildir:~/Maildir
passdb {
args = scheme=sha512-crypt /etc/mail/passwd
driver = passwd-file
}
userdb {
args = uid=vmail gid=vmail home=/var/vmail/%d/%n
driver = static
}
protocols = imap lmtp
service imap-login {
inet_listener imaps {
port = 993
ssl = yes
}
# Disable imap
inet_listener imap {
port = 0
}
}
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Trash {
special_use = \Trash
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox virtual/Flagged {
special_use = \Flagged
comment = All my flagged messages
}
prefix =
}
目前的情况是,INBOX 已正确创建并存储在 中/var/vmail/domain.tld/user/Maildir/
。我希望它存在于 中/var/vmail/domain.tld/user/Maildir/INBOX
。
与 MTA 同步时,我无法获取“已发送”、“已删除”、“垃圾邮件”...文件夹。
我究竟做错了什么?
答案1
我的配置和您不完全相同,但我有虚拟邮箱(用于群组),并且特殊邮箱不会自动创建。我必须编写一个脚本才能做到这一点(脚本在 中执行incron
):
ManageGroup() {
if [[ -d "/var/mail/group/${1}" ]]; then
cat <<EOMaint | doveadm exec imap -u "${1}"
1 select Sent
2 select Trash
3 select Junk
EOMaint
fi
}
for group in /var/mail/group/*; do
ManageGroup ${group##*/}
done
答案2
添加auto = create
到文件夹会自动创建它们。这似乎解决了问题。另外,我不明白它到底Maildir++
是如何工作的,我期待着更多类似的东西LAYOUT:fs
。请参阅https://wiki.dovecot.org/MailLocation/Maildir