[Dovecot] doveadm purge -A via doveadm-proxy director fails after some users

Daniel Parthey daniel.parthey at informatik.tu-chemnitz.de
Wed Aug 1 23:25:02 EEST 2012


Timo Sirainen wrote:
> On 1.8.2012, at 22.32, Daniel Parthey wrote:
> 
> >>>> Jun 29 15:40:31 10.129.3.249 dovecot: doveadm(user31 at domain1.example.org):
> >>>> Error: user user31 at domain1.example.org: Error reading configuration:
> >>>> net_connect_unix(/var/run/dovecot/config) failed: Permission denied
> > The change in 2.1.8 didn't fix it and still does not iterate *all* users.
> > My current workaround is to list all users, run a for-loop over the userlist
> > and flush one mailbox after another via the director.
> > 
> > Any hints how to solve this?
> 
> The error is still the same "config permission denied" shown above? I found that also from my server and added a debug patch, but it hasn't crashed yet. Could you try the attached patch and getting a gdb backtrace from the resulting core file? (Or at least the raw backtrace - getting a core file might be tricky.)

Running command on a four host setup with mailbox+director instance each:
/usr/bin/doveadm -c /etc/dovecot-director/dovecot-director.conf -D purge -A

Output is:
doveadm(username at example.org): Error: doveadm server failure
doveadm: Error: Failed to iterate through some users

Log says:
dovecot: doveadm(username at example.org): Error: userdb lookup: connect(/var/run/dovecot/auth-userdb) failed: Permission denied (euid=501(vmail) egid=123(vmail) missing +r perm: /var/run/dovecot/auth-userdb, we're not in group 122(dovecot), dir owned by 0:0 mode=0755)
dovecot: doveadm(username at example.org): Error: purge: User lookup failed: Internal error occurred. Refer to server log for more information.

Here are the directory permissions:

mail01:~# id vmail
uid=501(vmail) gid=123(vmail) groups=123(vmail)

mail01:~# id dovecot
uid=120(dovecot) gid=122(dovecot) groups=122(dovecot)

mail01:~# ls -ld /var/run/dovecot
drwxr-xr-x 4 root root 660 2012-07-11 18:35 /var/run/dovecot

mail01:~# ls -l /var/run/dovecot
total 8
srw------- 1 root    root      0 2012-07-10 18:29 anvil
srw------- 1 root    root      0 2012-07-10 18:29 anvil-auth-penalty
srw------- 1 root    root      0 2012-07-11 18:35 auth-client
srw------- 1 dovecot root      0 2012-07-11 18:35 auth-login
srw------- 1 root    root      0 2012-07-11 18:35 auth-master
srw-rw---- 1 dovecot dovecot   0 2012-07-11 18:35 auth-userdb
srw------- 1 dovecot root      0 2012-07-11 18:35 auth-worker
srw------- 1 root    root      0 2012-07-11 18:35 config
srw-rw---- 1 root    vmail     0 2012-07-11 18:35 dict
srw------- 1 root    root      0 2012-07-11 18:35 director-admin
srw------- 1 root    root      0 2012-07-10 10:19 director-userdb
srw-rw-rw- 1 root    root      0 2012-07-11 18:35 dns-client
srw------- 1 root    root      0 2012-07-11 18:35 doveadm-server
lrwxrwxrwx 1 root    root     25 2012-07-10 18:29 dovecot.conf -> /etc/dovecot/dovecot.conf
drwxr-xr-x 2 root    root     40 2012-07-10 10:19 empty
srw------- 1 root    root      0 2012-07-11 18:35 imap-postlogin
srw-rw-rw- 1 root    root      0 2012-07-11 18:35 indexer
srw------- 1 dovecot root      0 2012-07-11 18:35 indexer-worker
srw------- 1 root    root      0 2012-07-11 18:35 ipc
srw-rw-rw- 1 root    root      0 2012-07-11 18:35 lmtp
srw------- 1 root    root      0 2012-07-11 18:35 log-errors
drwxr-x--- 2 root    nogroup 180 2012-07-11 18:35 login
-rw------- 1 root    root      5 2012-07-10 18:29 master.pid
-rw-r--r-- 1 root    root     71 2012-07-10 18:29 mounts
srw------- 1 root    root      0 2012-07-11 18:35 pop3-postlogin
srw------- 1 vmail   root      0 2012-07-11 18:35 quota-warning
srw------- 1 root    root      0 2012-07-11 18:35 replication-notify
prw------- 1 root    root      0 2012-07-11 18:35 replication-notify-fifo
srw------- 1 dovecot root      0 2012-07-11 18:35 replicator
srw------- 1 root    root      0 2012-07-11 18:35 stats
prw------- 1 vmail   root      0 2012-08-01 22:20 stats-mail

Please see mailbox and director config attached.

Any help is appreciated.

Regards
Daniel
-- 
https://plus.google.com/103021802792276734820
-------------- next part --------------
# 2.1.8: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-40-server x86_64 Ubuntu 10.04.4 LTS 
auth_cache_negative_ttl = 0
auth_cache_size = 10 M
auth_cache_ttl = 1 mins
auth_verbose = yes
auth_verbose_passwords = sha1
deliver_log_format = mailbox: deliver: msgid=%m from=%f: %$
dict {
  quota = mysql:/etc/dovecot/conf.d/dovecot-dict-sql.conf.ext
}
disable_plaintext_auth = no
doveadm_password = xxx
imapc_features = rfc822.size
imapc_host = local-mailbox
imapc_port = 18143
instance_name = dovecot-mailbox
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
login_greeting = Mailbox
login_log_format = mailbox: login: %$: %s
login_trusted_networks = 10.129.3.0/24
mail_debug = yes
mail_fsync = always
mail_gid = vmail
mail_home = /mail/dovecot/%d/%n
mail_location = mdbox:~/mail
mail_log_prefix = "mailbox: mail: %s(%u): "
mail_plugins = quota stats
mail_privileged_group = vmail
mail_uid = vmail
managesieve_implementation_string = Sieve
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 ihave
mdbox_rotate_interval = 1 weeks
mdbox_rotate_size = 50 M
mmap_disable = yes
passdb {
  args = /etc/dovecot/conf.d/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  quota = dict:User quota::proxy::quota
  quota_rule = *:storage=10G
  quota_rule2 = Trash:storage=+100M
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
  stats_refresh = 30 secs
  stats_track_cmds = yes
}
protocols = imap pop3 lmtp sieve
service auth {
  unix_listener auth-userdb {
    group = dovecot
    mode = 0660
    user = dovecot
  }
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
  }
}
service doveadm {
  inet_listener doveadm-server {
    port = 19000
  }
}
service imap-login {
  inet_listener imap {
    port = 19143
  }
}
service imap-postlogin {
  executable = script-login /usr/local/bin/dovecot-postlogin
  user = $default_internal_user
}
service imap {
  executable = imap imap-postlogin
}
service lmtp {
  inet_listener lmtp {
    address = *
    port = 19024
  }
}
service managesieve-login {
  inet_listener sieve {
    port = 19200
  }
}
service pop3-login {
  inet_listener pop3 {
    port = 19110
  }
}
service pop3-postlogin {
  executable = script-login /usr/local/bin/dovecot-postlogin
  user = $default_internal_user
}
service pop3 {
  executable = pop3 pop3-postlogin
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning
  extra_groups = dovecot
  unix_listener quota-warning {
    user = vmail
  }
  user = vmail
}
service stats {
  fifo_listener stats-mail {
    mode = 0600
    user = vmail
  }
}
ssl = no
userdb {
  driver = prefetch
}
userdb {
  args = /etc/dovecot/conf.d/dovecot-sql.conf.ext
  driver = sql
}
verbose_proctitle = yes
protocol imap {
  imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
  mail_plugins = quota stats imap_quota imap_stats
}
protocol lmtp {
  mail_plugins = quota stats sieve
}
-------------- next part --------------
# 2.1.8: /etc/dovecot-director/dovecot-director.conf
# OS: Linux 2.6.32-40-server x86_64 Ubuntu 10.04.4 LTS 
auth_verbose = yes
auth_verbose_passwords = sha1
base_dir = /var/run/dovecot-director
deliver_log_format = director: deliver: msgid=%m from=%f: %$
director_doveadm_port = 20000
director_mail_servers = 10.129.3.193 10.129.3.192 10.129.3.191 10.129.3.190
director_servers = 10.129.3.193 10.129.3.192 10.129.3.191 10.129.3.190
director_user_expire = 2 days
disable_plaintext_auth = no
doveadm_password = xxx
doveadm_proxy_port = 19000
instance_name = dovecot-director
lmtp_proxy = yes
login_greeting = Mail Balancer
login_log_format = director: login: %$: %s
login_trusted_networks = 10.129.3.0/24
mail_debug = yes
mail_fsync = always
mail_gid = vmail
mail_home = /mail/dovecot/%d/%n
mail_location = mdbox:~/mail
mail_log_prefix = "director: mail: %s(%u): "
mail_privileged_group = vmail
mail_uid = vmail
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 ihave
mmap_disable = yes
passdb {
  args = /etc/dovecot-director/conf.d/dovecot-sql.conf.ext
  driver = sql
}
protocols = imap pop3 lmtp sieve
service auth {
  unix_listener auth-userdb {
    user = dovecot
  }
}
service director {
  fifo_listener login/proxy-notify {
    mode = 0666
  }
  inet_listener {
    port = 9090
  }
  unix_listener director-userdb {
    mode = 0600
  }
  unix_listener login/director {
    mode = 0666
  }
}
service doveadm {
  executable = doveadm-server director
  inet_listener doveadm-server {
    port = 20000
  }
}
service imap-login {
  executable = imap-login director
  inet_listener imap {
    port = 20143
  }
  inet_listener imaps {
    port = 20993
    ssl = yes
  }
}
service lmtp {
  inet_listener lmtp {
    address = *
    port = 20024
  }
}
service managesieve-login {
  executable = managesieve-login director
  inet_listener sieve {
    port = 20200
  }
}
service pop3-login {
  executable = pop3-login director
  inet_listener pop3 {
    port = 20110
  }
  inet_listener pop3s {
    port = 20995
    ssl = yes
  }
}
ssl_cert = </etc/certs/wildcard.net.crt
ssl_key = </etc/certs/wildcard.net.key
userdb {
  driver = prefetch
}
userdb {
  args = /etc/dovecot-director/conf.d/dovecot-sql.conf.ext
  driver = sql
}
verbose_proctitle = yes
protocol lmtp {
  auth_socket_path = director-userdb
}
protocol sieve {
  auth_socket_path = director-userdb
}
protocol doveadm {
  auth_socket_path = director-userdb
}
protocol imap {
  imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
}


More information about the dovecot mailing list