0

I'm trying to set up a dovecot mysql dict for quota in a FreeBSD jail.

This is the log I'm getting:

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

These are my file permissions:

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

This is /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/

And this is my dovecot.conf:

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

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

What am I missing?

3 Answers 3

0

Looks like you are running dovecot under 'mail' user, but dovecot-dict-sql.conf can be read only by root. Chmod it to 440

3
  • I even set it to 444 already but nothing changed
    – basbebe
    Jan 13, 2016 at 9:59
  • Did you ensure that file is accessible from inside jail? Jan 13, 2016 at 10:04
  • It is in the jail and all the other config files are read correctly
    – basbebe
    Jan 13, 2016 at 10:05
0
  1. chown mysql /etc/dovecot/dovecot-dict-quota.conf
  2. chmod mysql g+rw /etc/dovecot/dovecot-dict-quota.conf
0

chown -R root:mail /etc/dovecot/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .