[Dovecot] misconception in uid and gid

Felix Rubio Dalmau felixrubiodalmau at gmail.com
Thu Aug 1 16:43:26 EEST 2013


Hi,

	I'm using a SQL database to store the usernames and passwords of my users. However, I have found that I must explicitly return the uid and gid with every query, even though all virtual users use the same uid and gid. The query, that works, is:

	user_query = SELECT mail, 'vmail' AS uid, 'vmail' AS gid, home, CONCAT('*:storage=', quota_MB*1024) AS quota_rule \
             FROM virtual_users AS V LEFT JOIN virtual_domains AS D ON V.domain_id=D.id WHERE V.user='%n' AND D.name='%d'

Nevertheless, if I remove the segments "'vmail' AS uid, 'vmail' AS gid" and modify the file conf.d/10-mail.conf to show

	mail_uid = vmail
	mail_gid = vmail

I get this error:

	dovecot: auth: Error: userdb(<mail>): client doesn't have lookup permissions for this user: userdb reply doesn't contain uid (change userdb socket permissions)

Does anybody know what is wrong in my set-up?
Regards,

Felix


More information about the dovecot mailing list