[Dovecot] Static home while using LDAP

David Bosque dbosque at cica.es
Fri Oct 26 10:51:14 EEST 2007



Daniel L. Miller escribió:
> David Bosque wrote:
>> Hello all,
>>
>> I've been googling for a workaround for this for nearly a week to no 
>> avail and I hope someone in the list can shed some light on it.
>>
>> I have downloaded and compiled dovecot 1.0.5 and applied the 
>> quota-warning to it. I have configured everything and it's working 
>> wonderfully, even the lda with the sieve plugin. This is my current 
>> relevant configuration:
>>
>> userdb static{
>> args = uid=501 gid=12 home=/var/mail/buzones/%d/%n allow_all_users=yes
>> }
>>
>> passdb ldap {
>>    args =  /etc/dovecot/dovecot-ldap.conf
>> }
>>
>> However, I need to obtain some more data from LDAP, so I need to 
>> switch to an ldap userdb, but want to keep the home as it is in the 
>> static configuration and not having to store it in LDAP. Is it 
>> possible to use a fixed home (as in the static userdb) while using an 
>> ldap userdb? I am looking for something similar to user_global_uid 
>> and user_global_gid but for the "home". If not, is it possible to fix 
>> or append something to the values in the user_attrs (like the 
>> following)?
>>
>> user_attrs = [whatever_i_want_to_append]uid=home 
>> uidNumber=uid,gidNumber=gid
>>
>> Regards,
>> David Bosque
> You're almost there - but not quite.  Instead, you'll use the 
> pass_attrs in your ldap config for both password and user info - but 
> prefix the needed userdb arguments with "userdb_". So:
>
> pass_attrs = userPassword=password,userdb_somearg=ldapsomearg,etc.
>
You mean I should keep the userdb static and the passdb ldap, right?

When I do that:

userdb static{
args = uid=501 gid=12
}

passdb ldap {
   args =  /etc/dovecot/dovecot-ldap.conf
}

In dovecot-ldap.conf :
pass_attrs = uid=user,postOfficeBox=userdb_home

I get this:

dovecot: Oct 26 09:28:23 Info: auth(default): ldap(dbosque,X.X.X.X): 
bind search: base=dc=cuentas, dc=cica, dc=es 
filter=(&(objectClass=posixAccount)(uid=dbosque))
dovecot: Oct 26 09:28:23 Info: auth(default): ldap(dbosque,X.X.X.X): 
result: uid(user)=dbosque 
postOfficeBox(userdb_home)=/var/mail/buzones/dbosque
dovecot: Oct 26 09:28:23 Info: auth(default): ldap(dbosque,X.X.X.X): 
bind: dn=uid=dbosque,dc=cica,dc=cuentas,dc=cica,dc=es
dovecot: Oct 26 09:28:23 Info: auth(default): client out: OK    1       
user=dbosque
dovecot: Oct 26 09:28:23 Info: auth(default): master in: REQUEST        
2       1116    1
dovecot: Oct 26 09:28:23 Info: auth(default): master out: USER  2       
dbosque uid=501 gid=12
dovecot: Oct 26 09:28:23 Info: pop3-login: Login: user=<dbosque>, 
method=PLAIN, rip=X.X.X.X, lip=X.X.X.X, TLS
dovecot: Oct 26 09:28:23 Error: POP3(dbosque): 
mkdir(/HOME_DIRECTORY_USED_BUT_NOT_GIVEN_BY_USERDB/mail/cur) failed: 
Permission denied
dovecot: Oct 26 09:28:23 Error: POP3(dbosque): 
mkdir(/HOME_DIRECTORY_USED_BUT_NOT_GIVEN_BY_USERDB/mail/cur) failed: 
Permission denied


As you can see, it is seeing the userdb_home attribute, but no using it 
where it should. However, if I set:

 userdb prefetch {
 }

...it will do use the home set by userdb_home, but then I will have to 
store the home attribute in LDAP.

Is there any other way of using a static home (not stored in LDAP) but 
being able to use LDAP for quotas and other stuff?

Thanks a lot,
David Bosque

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3861 bytes
Desc: S/MIME Cryptographic Signature
Url : http://dovecot.org/pipermail/dovecot/attachments/20071026/b15fee33/attachment-0001.bin 


More information about the dovecot mailing list