这是我的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