On Sunday 05 October 2008 16:47:26 Timo Sirainen wrote:
It doesn't show anything about quota rules, so the quota_rule isn't being specified correctly by your userdb. Show your dovecot-sql.conf, enable auth_debug=yes and show what the logs say when logging in.
the log says: Oct 5 16:55:44 host dovecot: auth(default): client in: AUTH^I1^IPLAIN^Iservice=imap^Ilip=x.x.x.x^Irip=x.x.x.x^Ilport=143^Irport=49910^Iresp=<hidden> Oct 5 16:55:44 host dovecot: auth(default): cache(testuser,x.x.x.x): miss Oct 5 16:55:44 host dovecot: auth-worker(default): sql(testuser,x.x.x.x): query: SELECT user, clear as password, home as userdb_home, uid as userdb_uid, gid as userdb_gid FROM users WHERE user = 'testuser' Oct 5 16:55:44 host dovecot: auth(default): client out: OK^I1^Iuser=testuser Oct 5 16:55:44 host dovecot: auth(default): master in: REQUEST^I1^I19559^I1 Oct 5 16:55:44 host dovecot: auth(default): prefetch(testuser,x.x.x.x): success Oct 5 16:55:44 host dovecot: auth(default): master out: USER^I1^Itestuser^Ihome=/var/vmail/testuser^Iuid=95^Igid=95 Oct 5 16:55:44 host dovecot: imap-login: Login: user=<testuser>, method=PLAIN, rip=x.x.x.x, lip=x.x.x.x Oct 5 16:55:44 host dovecot: auth(default): new auth connection: pid=19559 Oct 5 16:55:44 host dovecot: IMAP(testuser): Loading modules from directory: /usr/local/dovecot/lib/dovecot/imap Oct 5 16:55:44 host dovecot: IMAP(testuser): Module loaded: /usr/local/dovecot/lib/dovecot/imap/lib10_quota_plugin.so Oct 5 16:55:44 host dovecot: IMAP(testuser): Module loaded: /usr/local/dovecot/lib/dovecot/imap/lib11_imap_quota_plugin.so Oct 5 16:55:44 host dovecot: IMAP(testuser): Effective uid=95, gid=95, home=/var/vmail/testuser Oct 5 16:55:44 host dovecot: IMAP(testuser): Quota root: name= backend=dict args=:proxy:/var/run/dovecot/dict-server:quotadict Oct 5 16:55:44 host dovecot: IMAP(testuser): dict quota: user=testuser, uri=proxy:/var/run/dovecot/dict-server:quotadict, enforcing=0 Oct 5 16:55:44 host dovecot: IMAP(testuser): Namespace: type=private, prefix=, sep=., inbox=yes, hidden=no, list=yes, subscriptions=yes Oct 5 16:55:44 host dovecot: IMAP(testuser): maildir: data=/var/vmail/testuser/Maildir Oct 5 16:55:44 host dovecot: IMAP(testuser): maildir++: root=/var/vmail/testuser/Maildir, index=, control=, inbox=/var/vmail/testuser/Maildir Oct 5 16:55:47 host dovecot: dict: mysql: Connected to /tmp/mysql.sock (mail) Oct 5 16:55:53 host dovecot: IMAP(testuser): Disconnected: Logged out bytes=24/85
For some reason the user_query is not executed, only password_query.
Here is my dovecot-sql.conf:
driver = mysql connect = host=/tmp/mysql.sock dbname=mail user=dovecot password=xxx default_pass_scheme = PLAIN
password_query = SELECT user, clear as password, home as userdb_home, uid as userdb_uid, gid as userdb_gid
FROM users WHERE user = '%u'
user_query = SELECT home, uid, gid,
concat('*:storage=',quota_kb,':messages=',quota_num) AS quota_rule,
concat('storage=',round(quota_kb*0.90),' /etc/postfix/quotawarn.sh storage 90') AS quota_warning,
concat('messages=',round(quota_num*0.90),' /etc/postfix/quotawarn.sh messages 90') AS quota_warning2
FROM users WHERE user = '%u'
Regards, Arvids