[Dovecot] dovecot 1.2 quota with local users

iti at promax.media.pl iti at promax.media.pl
Wed Mar 16 12:38:07 EET 2011


Hello,
I got problem with setting quota from mysql for local users. In database
are only information with quota. Password are store in passwd/shadow.


My database have only simple info like in wiki description. Table created
with:


CREATE TABLE quota (
  username varchar(100) not null,
  bytes bigint not null default 0,
  messages integer not null default 0,
  primary key (username)
);

In dovecot.conf like in description is:


dict {
  quotadict = mysql:/etc/dovecot-dict-sql.conf
}

plugin {
  # v1.2 + SQL:
  quota = dict:user::proxy::quotadict
  # v1.2 + file:
  quota = dict:user::file:%h/Maildir/dovecot-quota

  quota_rule = *:storage=10M:messages=1000
}


File dovecot-dict-sql.conf has:


# v1.2+ only:
connect = host=localhost dbname=mails user=sqluser password=sqlpass
map {
  pattern = priv/quota/storage
  table = quota
  username_field = username
  value_field = bytes
}
map {
  pattern = priv/quota/messages
  table = quota
  username_field = username
  value_field = messages
}


With corrected values about databasename, user and password.

Where should to add information about sql query when autorization is not
via myqsl (only shadow/password).
There are in description info about additional file with user_query:
dovecot-mysql.conf. Can anybody know how it should it look like and where
to add it in config?







More information about the dovecot mailing list