[Dovecot] still having difficulties with per-user quotas
Daniel Parthey
daniel.parthey at informatik.tu-chemnitz.de
Sat Oct 20 23:04:32 EEST 2012
David Mehler wrote:
> Thanks for your reply. So with the extending of the query to return a
> default quota rule, do you have an example of that by the way, does
> that mean I only have to put the overrided users in the quota table?
Assuming that quota values are in the dovecot_users table...
# passdb with userdb prefetch and default quota of 1024M for quota=0 rows
# The userdb_ prefix is for prefetch userdb entries in password_query
password_query = SELECT username AS user, \
password AS password, \
home AS userdb_home, \
uid AS userdb_uid, \
gid AS userdb_gid, \
CASE quota \
WHEN 0 \
THEN '*:bytes=1024M:messages=0' \
ELSE \
CONCAT('*:bytes=', CAST(quota AS CHAR), 'M:messages=', CAST(quota_message AS CHAR)) \
END AS `userdb_quota_rule` \
FROM dovecot_users \
WHERE username='%u';
# user_query with default quota of 1024M for quota=0 rows
user_query = SELECT username AS user, \
home AS home, \
uid AS uid, \
gid as gid, \
CASE quota \
WHEN 0 \
THEN '*:bytes=1024M:messages=0' \
ELSE \
CONCAT('*:bytes=', CAST(quota AS CHAR), 'M:messages=', CAST(quota_message AS CHAR)) \
END AS `quota_rule` \
FROM dovecot_users \
WHERE username='%u';
Your user_query needs to return a row if the user exists,
otherwise dovecot will assume that the user does not exist
and the mail or user will be rejected.
Regards
Daniel
--
https://plus.google.com/103021802792276734820
More information about the dovecot
mailing list