[Dovecot] Problem with quota-dict

Sascha Bendix sascha.bendix at localroot.de
Mon Jul 20 22:13:15 EEST 2009


Hi,

I wanted to migrate a mailserver from cyrus to dovecot. The new setup was 
using postfixadmin let the domain admins configure the hostet domains.

To view the used quota in postfixadmin the usage of the quota dict backend is 
required. I have configured it according to the wiki but everytime I connect I 
get a sucessfully login and then every next command hangs. It seems to me, 
that the dict process itself is hanging. I even startet with a fresh mail box. 
The only way to login with my setup is to disable quota for the used protocol.

My system is debian lenny based with dovecot 1.0.15 and PostgreSQL 8.3.7 as 
database server. My config is the following:

# 1.0.15: /etc/dovecot/dovecot.conf
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imaps pop3s managesieve
listen: [::]
ssl_cert_file: /etc/ssl/certs/server.crt
ssl_key_file: /etc/ssl/private/server.key
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
login_greeting: Ready.
first_valid_uid: 8
last_valid_uid: 8
mail_privileged_group: mail
mail_location: maildir:/var/mail/%d/%n
mail_debug: yes
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_plugins(default): quota imap_quota acl
mail_plugins(imap): quota imap_quota acl
mail_plugins(pop3): quota
mail_plugins(managesieve):
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
pop3_uidl_format(default):
pop3_uidl_format(imap):
pop3_uidl_format(pop3): %v.%u
pop3_uidl_format(managesieve):
sieve_storage(default):
sieve_storage(imap):
sieve_storage(pop3):
sieve_storage(managesieve): /var/mail/sieve/%d/%n
sieve(default):
sieve(imap):
sieve(pop3):
sieve(managesieve): /var/mail/sieve/%d/%n.sieve
namespace:
  type: private
  inbox: yes
auth default:
  user: dovecot-auth
  passdb:
    driver: sql
    args: /etc/dovecot/dovecot-sql.conf
  userdb:
    driver: sql
    args: /etc/dovecot/dovecot-sql.conf
  socket:
    type: listen
    client:
      path: /var/spool/postfix/private/auth
      mode: 432
    master:
      path: /var/run/dovecot/auth-master
      mode: 384
      user: mail
      group: mail
plugin:
  quota: dict:storage=10240 proxy::quota
  acl: vfile:/etc/dovecot/acls
  sieve: /var/mail/sieve/%d/%n.sieve
dict:
  quota: pgsql:/etc/dovecot/dovecot-dict-quota.conf

My /etc/dovecot/dovecot-dict-quota.conf:

connect = host=localhost dbname=mail user=mail password=dovecot-passwort
table = quota
select_field = current
where_field = path
username_field = username

My database table:

CREATE TABLE quota
(
  username character varying(255) NOT NULL,
  path character varying(100) NOT NULL,
  "current" integer,
  CONSTRAINT quota_pkey PRIMARY KEY (username, path)
)
WITH (OIDS=FALSE);
ALTER TABLE quota OWNER TO mail;

-- Trigger: mergequota on quota

-- DROP TRIGGER mergequota ON quota;

CREATE TRIGGER mergequota
  BEFORE INSERT
  ON quota
  FOR EACH ROW
  EXECUTE PROCEDURE merge_quota();
connect = host=localhost dbname=mail user=dovecot password=jianueyeePeev5o
table = quota
select_field = current
where_field = path
username_field = username

My dovecot logfile with mail_debug=yes:

Jul 20 21:06:17 skippy dovecot: Dovecot v1.0.15 starting up
Jul 20 21:06:17 skippy dovecot: auth(default): pgsql: Connected to mail
Jul 20 21:07:07 skippy dovecot: POP3(user at domain.tld): Loading modules from 
directory: /usr/lib/dovecot/modules/pop3
Jul 20 21:07:07 skippy dovecot: POP3(user at domain.tld): Module loaded: 
/usr/lib/dovecot/modules/pop3/lib10_quota_plugin.so
Jul 20 21:07:07 skippy dovecot: POP3(user at domain.tld): Effective uid=8, gid=8
Jul 20 21:07:07 skippy dovecot: POP3(user at domain.tld): maildir: 
data=/var/mail/domain.tld/user
Jul 20 21:07:07 skippy dovecot: POP3(user at domain.tld): maildir: 
root=/var/mail/domain.tld/user, index=/var/mail/domain.tld/user, control=, 
inbox=
Jul 20 21:07:07 skippy dovecot: POP3(user at domain.tld): dict quota: uri = 
proxy::quota
Jul 20 21:07:07 skippy dovecot: POP3(user at domain.tld): dict quota: byte limit 
= 52428800
Jul 20 21:07:07 skippy dovecot: POP3(user at domain.tld): dict quota: count limit 
= 0
Jul 20 21:07:07 skippy dovecot: pop3-login: Login: user=<user at domain.tld>, 
method=PLAIN, rip=::ffff:1.2.3.4, lip=::ffff:1.2.3.5, TLS
Jul 20 21:07:07 skippy dovecot: dict: pgsql: Connected to mail
Jul 20 21:07:07 skippy dovecot: dict: Timeout leak: 0x40e150
Jul 20 21:07:07 skippy dovecot: dict: WARNING:  there is no transaction in 
progress

I'm a little bit clueless because there is no significant output (even in 
strace). Can you please give me a clue?

Regards,

Sascha Bendix


More information about the dovecot mailing list