dovecot /var/vmail 的正确权限是什么(在 ispconfig、Debian 上)

sut*_*her 1 permissions debian dovecot

如果您从 courier 迁移到 dovecot 并将所有文件从旧服务器复制到带有 Dovecot 的新 ISPConfig 中,您可能会遇到权限问题。

邮件日志可能会显示如下消息:

11 月 19 日 14:09:44 yourServerName dovecot:lda(info@badabim.com):错误:打开(/var/vmail/badabim.com/info/Maildir/maildirsize)失败:权限被拒绝

或者

失败:权限被拒绝 (euid=5000(vmail) egid=5000(vmail) 缺少 +r perm: /var/vmail/badabim.com/info/Maildir/cur/cur:2,S)

现在什么是正确的权限?

sut*_*her 5

我想出了这个命令来以正确的方式设置权限。将其复制到文件(例如 /var/vmail/chmod_vmail)并使其可执行。

如果您现在位于 /var/vmail 的子文件夹中(或该文件夹本身),您所要做的就是执行脚本。

chown vmail:vmail /var/vmail/ -R
find . -type d -name Maildir -exec chmod 700 -R {} \;
find . -type f \( -name '.sieve' -o -name '.sieve.svbin' \) -exec chmod 644 {} \;
find . -type f \( -name 'courierimapsubscribed' -o -name 'subscriptions' \) -exec chmod 744 {} \;
find . -type f \( -name 'dovecot-uidlist' -o -name 'dovecot-uidvalidity' -o -name 'dovecot.index.cache' -o -name 'dovecot.index.log' -o -name 'maildirsize'  \) -exec chmod 600 {} \;
find . -type f \( -name 'dovecot-uidvalidity.*'  \) -exec chmod 444 {} \;
Run Code Online (Sandbox Code Playgroud)

享受并不要忘记对此答案进行评分,或发布此代码的增强功能。