[Dovecot] domain variable still empty

Andre Rodier andre.rodier at red2.co.uk
Mon Apr 11 09:42:21 EEST 2011

 On Mon, 11 Apr 2011 06:11:08 +0100, Andre Rodier wrote:
> On Mon, 11 Apr 2011 00:35:33 +0300, Timo Sirainen wrote:
>> On 11.4.2011, at 0.19, Andre Rodier wrote:
>>> What surprise me is this line during the authentication:
>>> ===> auth(arodier at red2team, username changed 
>>> arodier at red2team -> arodier
>> That means that the username gets changed from %n = arodier and %d =
>> redteam2 to %n = arorier and %d = empty. So I don't understand why 
>> %d
>> would ever be anything else than empty.
>> Anyway, http://wiki2.dovecot.org/DomainLost
> Thanks Timo,
> it was what I thought. However, even if I know know the cause, it
> doesn't help me too much to do what I want.
> In the link provided, none of the reason is applied in my settings.
> - My auth_username_format is set to the full username+domain, event
> empty, it's dropped.
> - I use LDAP, not SQL, so I don't know how to return the domain from
> my query.
> The question is now, how can I return both the username and the
> domain from LDAP, please ? Once I have the answer, I can add the
> information to the wiki page.
> However, it seems I can use this method, specified on this page:
> http://wiki.dovecot.org/AuthDatabase/LDAP/Userdb:
>> You can add static fields that aren't looked up from LDAP 
>> (v1.1.rc5+).
>> For example create a "mail" field with value "/var/vmail/%d/%n":
>> user_attrs = \
>>   quotaBytes=quota_rule=*:bytes=%$, \
>>   =mail=/var/vmail/%d/%n
> It is exactly what I want to do. But once I have created a "mail"
> field, how can I access this field from the main dovecot 
> configuration
> file, please ?
> Thanks for your answer and your patience.
> Once I have finished to setup my environment, I'll publish a document
> to help others.
> Kind regards,

 Hello again, Timo, I am nearly there.

 I finally got it working, using the ldap prefetch option. I don't know 
 why, but it is only in this way that the '%d' domain is kept after the 

 Now, this line is normally resolved in my private namespace (mail 
   => location = maildir:/home/emails/%d/%%n/Maildir:

 In my dovecot ldap configuration:

 hosts = callisto.red2.srv thebe.red2.srv
 auth_bind = yes
 ldap_version = 3
 base = dc=red2,dc=srv
 scope = subtree
 user_attrs = 
 user_filter = (&(objectClass=posixAccount)(uid=%n))
 pass_attrs = uid=uid,userPassword=password,\
 pass_filter = (&(objectClass=posixAccount)(uid=%n)(ou=%d))
 default_pass_scheme = PLAIN-MD5

 Obviously, I now need to cleanup and remove all options that are not 

 Kind regards,

More information about the dovecot mailing list