Dovecot dict:无法打开配置文件,权限被拒绝

Dovecot dict:无法打开配置文件,权限被拒绝

我正在尝试在 FreeBSD jail 中为配额设置 dovecot mysql dict。

这是我收到的日志:

an 13 10:03:23 mail dovecot: dict(71120): Error: Failed to initialize dictionary 'sqlquota': dict mysql: Can't open configuration file /usr/local/etc/dovecot/dovecot-dict-sql.conf: Permission denied

这些是我的文件权限:

5 -r--------   1 root  mail    353 12 Jan 16:41 dovecot-dict-sql.conf
5 -r--------   1 root  mail    526 12 Jan 17:04 dovecot-sql.conf
5 -r--r-----   1 root  mail   5531 13 Jan 09:58 dovecot.conf

这是/var/run/dovecot

9 drwxr-xr-x   5 root     wheel     37 13 Jan 10:02 ./
9 drwxr-xr-x  11 root     wheel     20 13 Jan 09:42 ../
1 srw-------   1 root     wheel      0 13 Jan 09:42 anvil
1 srw-------   1 root     wheel      0 13 Jan 09:42 anvil-auth-penalty
1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 auth-client
1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 auth-login
1 srw-rw----   1 vmail    mail       0 13 Jan 10:02 auth-master
1 -rw-------   1 root     wheel     32 13 Jan 09:42 auth-token-secret.dat
1 srw-rw-rw-   1 dovecot  wheel      0 13 Jan 10:02 auth-userdb
1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 auth-worker
1 srw-------   1 root     wheel      0 13 Jan 10:02 config
1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 decode2text
1 srw-rw----   1 root     mail       0 13 Jan 10:02 dict
1 srw-------   1 root     wheel      0 13 Jan 10:02 dict-async
1 srw-------   1 root     wheel      0 13 Jan 10:02 director-admin
1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 dns-client
1 srw-------   1 root     wheel      0 13 Jan 10:02 doveadm-server
1 lrwx------   1 root     wheel     35 13 Jan 09:42 dovecot.conf -> /usr/local/etc/dovecot/dovecot.conf
1 drwxr-xr-x   2 root     wheel      2 13 Jan 09:42 empty/
1 srw-------   1 root     wheel      0 13 Jan 10:02 imap-hibernate
1 srw-------   1 root     wheel      0 13 Jan 10:02 imap-master
1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 imap-urlauth
1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 imap-urlauth-worker
1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 indexer
1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 indexer-worker
1 srw-------   1 root     wheel      0 13 Jan 10:02 ipc
1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 lmtp
1 srw-------   1 root     wheel      0 13 Jan 10:02 log-errors
9 drwxr-x---   2 root     dovenull   7 13 Jan 10:02 login/
1 -rw-------   1 root     wheel      6 13 Jan 09:42 master.pid
1 srw-------   1 root     wheel      0 13 Jan 10:02 replication-notify
1 prw-------   1 root     wheel      0 13 Jan 10:02 replication-notify-fifo
1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 replicator
1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 ssl-params
1 srw-------   1 root     wheel      0 13 Jan 10:02 stats
1 prw-------   1 root     wheel      0 13 Jan 10:02 stats-mail
1 drwxr-x---   2 root     dovenull   4 13 Jan 10:02 token-login/

这是我的dovecot.conf

[…]
dict {
  sqlquota = mysql:/usr/local/etc/dovecot/dovecot-dict-sql.conf
}

service dict {
  unix_listener dict {
    mode = 0660
    group = mail
  }
}
[…]

我错过了什么?

答案1

看起来您正在以 'mail' 用户身份运行 dovecot,但 dovecot-dict-sql.conf 只能由 root 读取。将其修改为 440

答案2

  1. chown mysql /etc/dovecot/dovecot-dict-quota.conf
  2. chmod mysql g+rw /etc/dovecot/dovecot-dict-quota.conf

答案3

chown -R 根:邮件/etc/dovecot/

相关内容