[GELÖST] Failed to initialize dictionary 'sqlquota'

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
BrotherJ
Beiträge: 323
Registriert: 15.11.2018 07:56:18

[GELÖST] Failed to initialize dictionary 'sqlquota'

Beitrag von BrotherJ » 02.03.2021 15:32:17

Hallo zusammen,

ich ziehe gerade einen Server um (beides Debian Buster, Postfix, Dovecot) und auf der neuen Maschine sehe ich im LogFile:

Code: Alles auswählen

2 15:20:10 mx dovecot: dict(7711): Error: Failed to initialize dictionary 'sqlquota': dict mysql: Can't open configuration file /etc/dovecot/dovecot-dict-sql.conf: Permission denied
Mar  2 15:20:10 mx dovecot: dict(7711): Error: Failed to initialize dictionary 'sqlquota': dict mysql: Can't open configuration file /etc/dovecot/dovecot-dict-sql.conf: Permission denied
Mar  2 15:20:10 mx dovecot: imap(brotherj@example.tld)<7593><goPRUY68/Jhdw12K>: Error: Failed to get quota resource STORAGE: quota-dict: dict_lookup(priv/quota/storage) failed: write(/var/run/dovecot/dict) failed: Broken pipe (reply took 0.000 secs (0.000 in dict wait, 0.000 in other ioloops, 0.000 in locks))
wenn ich mit dem Mailclient zugreife.

Code: Alles auswählen

dovecot -n
# 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.4 ()
# OS: Linux 4.19.0-14-amd64 x86_64 Debian 10.8 
# Hostname: mx.example.tld
auth_mechanisms = plain login
dict {
  sqlquota = mysql:/etc/dovecot/dovecot-dict-sql.conf
}
listen = *
log_timestamp = "%Y-%m-%d %H:%M:%S "
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c %k
mail_home = /var/vmail/%d/%n
mail_location = maildir:~/
mail_max_userip_connections = 500
mail_plugins = quota acl fts fts_solr
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext
namespace {
  list = yes
  location = maildir:%%h/:INDEXPVT=~/Shared/%%u
  prefix = Shared/%%u/
  separator = /
  subscriptions = no
  type = shared
}
namespace inbox {
  inbox = yes
  location = 
  mailbox Archief {
    special_use = \Archive
  }
  mailbox Archiv {
    special_use = \Archive
  }
  mailbox Archive {
    auto = subscribe
    special_use = \Archive
  }
  mailbox Archives {
    special_use = \Archive
  }
  mailbox Arquivo {
    special_use = \Archive
  }
  mailbox Arquivos {
    special_use = \Archive
  }
  mailbox Brouillons {
    special_use = \Drafts
  }
  mailbox Concepten {
    special_use = \Drafts
  }
  mailbox Corbeille {
    special_use = \Trash
  }
  mailbox "Deleted Items" {
    special_use = \Trash
  }
  mailbox "Deleted Messages" {
    special_use = \Trash
  }
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Entwürfe {
    special_use = \Drafts
  }
  mailbox Enviados {
    special_use = \Sent
  }
  mailbox Envoyés {
    special_use = \Sent
  }
  mailbox "Gelöschte Objekte" {
    special_use = \Trash
  }
  mailbox Gesendet {
    special_use = \Sent
  }
  mailbox "Gesendete Objekte" {
    special_use = \Sent
  }
  mailbox "Itens Enviados" {
    special_use = \Sent
  }
  mailbox "Itens Excluídos" {
    special_use = \Trash
  }
  mailbox "Itens Excluidos" {
    special_use = \Trash
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox "Junk E-mail" {
    special_use = \Junk
  }
  mailbox Lixeira {
    special_use = \Trash
  }
  mailbox "Lixo Eletrônico" {
    special_use = \Junk
  }
  mailbox "Messages envoyés" {
    special_use = \Sent
  }
  mailbox "Ongewenste e-mail" {
    special_use = \Junk
  }
  mailbox Papierkorb {
    special_use = \Trash
  }
  mailbox Prullenbak {
    special_use = \Trash
  }
  mailbox Rascunhos {
    special_use = \Drafts
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox "Sent Items" {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Spam {
    special_use = \Junk
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  mailbox "Verwijderde items" {
    special_use = \Trash
  }
  mailbox Verzonden {
    special_use = \Sent
  }
  mailbox "Verzonden items" {
    special_use = \Sent
  }
  prefix = 
  separator = /
}
passdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
plugin {
  acl = vfile
  acl_anyone = allow
  acl_shared_dict = file:/var/vmail/shared-mailboxes.db
  quota = dict:Userquota::proxy::sqlquota
  quota_rule2 = Trash:storage=+100%%
  sieve = /var/vmail/sieve/%u.sieve
  sieve_after = /var/vmail/sieve/global.sieve
  sieve_max_script_size = 1M
  sieve_quota_max_scripts = 0
  sieve_quota_max_storage = 0
}
protocols = imap sieve lmtp pop3
service auth {
  unix_listener /var/spool/postfix/private/auth_dovecot {
    group = postfix
    mode = 0660
    user = postfix
  }
  unix_listener auth-master {
    mode = 0600
    user = vmail
  }
  unix_listener auth-userdb {
    mode = 0600
    user = vmail
  }
  user = root
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
  user = vmail
}
service managesieve-login {
  inet_listener sieve {
    port = 4190
  }
  process_min_avail = 2
  service_count = 1
  vsz_limit = 128 M
}
service managesieve {
  process_limit = 256
}
ssl_cert = </etc/letsencrypt/live/mx.example.tld/fullchain.pem
ssl_cipher_list = EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
ssl_prefer_server_ciphers = yes
userdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
verbose_proctitle = yes
protocol imap {
  mail_plugins = quota imap_quota imap_acl acl fts fts_solr
}
protocol lmtp {
  auth_socket_path = /var/run/dovecot/auth-master
  mail_plugins = quota sieve acl fts fts_solr
  postmaster_address = postmaster@example.tld
}
protocol sieve {
  managesieve_logout_format = bytes=%i/%o
}
remote 127.0.0.1 {
  disable_plaintext_auth = no
}

Code: Alles auswählen

# cat dovecot-dict-sql.conf
connect = "host=localhost dbname=postfix user=postfix password=secret"

map {
  pattern = priv/quota/storage
  table = quota2
  username_field = username
  value_field = bytes
}
map {
  pattern = priv/quota/messages
  table = quota2
  username_field = username
  value_field = messages
}
Die Permissions in /etc/dovecot sehen auf beiden Servern gleich aus:

Code: Alles auswählen

drwxr-xr-x 2 root root    4096 Feb 28 11:08 conf.d
-rw-r--r-- 1 root root     769 Feb 28 17:48 dh.pem
-rw-r--r-- 1 root root    5234 Mär  2 14:23 dovecot.conf
-rw-r--r-- 1 root root    5272 Mär  2 14:24 dovecot.conf.bak
-rw-r----- 1 root dovecot 1507 Feb 28 17:48 dovecot-dict-auth.conf.ext
-rw-rw---- 1 root vmail    294 Feb 28 17:48 dovecot-dict-sql.conf
-rw-r----- 1 root dovecot  852 Feb 28 17:48 dovecot-dict-sql.conf.ext
-rw-r----- 1 root root    1704 Feb 28 17:48 dovecot.key
-rw-r----- 1 root root     518 Mär  1 17:08 dovecot-mysql.conf
-rw-r--r-- 1 root root    5197 Feb 28 17:48 dovecot-new-2.3.conf
-rw-r--r-- 1 root root    5200 Mär  2 14:24 dovecot-new.conf
-rw-r--r-- 1 root root    1078 Feb 28 17:48 dovecot.pem
-rw-r----- 1 root dovecot 5612 Feb 28 17:48 dovecot-sql.conf.ext
drwx------ 2 root root    4096 Feb 28 11:08 private
Ich sehe momentan noch nicht den Grund dafür, dass auf dovecot-dict-sql.conf nicht zugriffen werden kann.
Habt Ihr eine Idee?

Beste Grüße

BrotherJ
Zuletzt geändert von BrotherJ am 04.03.2021 17:34:24, insgesamt 1-mal geändert.

hec_tech
Beiträge: 1093
Registriert: 28.06.2007 21:49:36
Wohnort: Wien
Kontaktdaten:

Re: Failed to initialize dictionary 'sqlquota'

Beitrag von hec_tech » 03.03.2021 17:26:11

Code: Alles auswählen

-rw-rw---- 1 root vmail    294 Feb 28 17:48 dovecot-dict-sql.conf
Das müsste doch root:dovecot sein. Weiters Gruppe bitte nur read.

BrotherJ
Beiträge: 323
Registriert: 15.11.2018 07:56:18

Re: Failed to initialize dictionary 'sqlquota'

Beitrag von BrotherJ » 04.03.2021 17:33:50

hec_tech hat geschrieben: ↑ zum Beitrag ↑
03.03.2021 17:26:11

Code: Alles auswählen

-rw-rw---- 1 root vmail    294 Feb 28 17:48 dovecot-dict-sql.conf
Das müsste doch root:dovecot sein. Weiters Gruppe bitte nur read.
Das war der entscheidende Punkt!

Vielen Dank!

BrotherJ

Antworten