[Dovecot] Master User Features I'd like to see

Marc Perkel marc at perkel.com
Mon Aug 16 02:21:02 EEST 2010



On 8/15/2010 3:06 PM, Timo Sirainen wrote:
> On 15.8.2010, at 22.46, Marc Perkel wrote:
>
>> passdb {
>>   driver = sql
>>   args = /etc/dovecot/dovecot-sql-master.conf.ext
>>   master = yes
>>   pass = yes
>> }
> ..
>> I'm assuming that the masteruser and masterpass is passed to the master passdb and when doing so the variable %u is the master user.  I assume that %n and %d also represent the name and domain part of the master user.
> Yes.
>
>> What I need is to also be able to have variables for the loginuser passed to the master user query. Something like %lu, %ln, and %ld perhaps. That way with MySQL tricks I might be able to see if the master user is master for that particular login user. That way I can give domain owners or owners of multiple domains the ability to manage the email accounts within their scope of permission.
>
> These are available in v2.0:
>
> %{login_user}
> %{login_username}
> %{login_domain}
>
> I guess they should be added to wiki..

Hi Timo,

I don't think it's working. I tried this query:

password_query = SELECT user_name, domain_name, password FROM users 
WHERE user_name = '%n' AND domain_name = '%d' AND owns_domain='1' AND 
'%d'='%{login_domain}'

It didn't work. However this did:

password_query = SELECT user_name, domain_name, password FROM users 
WHERE user_name = '%n' AND domain_name = '%d' AND owns_domain='1'

But that doesn't test the '%d'='%{login_domain}' part.

Am I missing something.

I should have been testing 2.0 earlier.



More information about the dovecot mailing list