[Dovecot] Automounted home dirs not working

Roy McMorran mcmorran at mdibl.org
Wed May 14 23:52:47 EEST 2008


Timo Sirainen wrote:
> On Mon, 2008-05-12 at 10:46 -0400, Roy McMorran wrote:
>   
>> ... but Dovecot isn't picking up the automounted 
>> directories.  Consider the case of Arthur Dent, test user:
>>
>>
>> May 12 10:30:24 testbed dovecot: [ID 107833 mail.info] imap-login: 
>> Login: user=<adent>, method=PLAIN, rip=xxx.xxx.xxx.242, 
>> lip=xxx.xxx.xxx.242, secured
>> May 12 10:30:24 testbed dovecot: [ID 107833 mail.error] IMAP(adent): 
>> mkdir_parents(/home/adent/Mail) failed: No such file or directory
>> May 12 10:30:24 testbed dovecot: [ID 107833 mail.error] IMAP(adent): 
>> Mail storage creation failed with mail_location: 
>> mbox:/home/adent/Mail:INBOX=/var/mail/adent
>> May 12 10:30:24 testbed dovecot: [ID 961074 mail.error] child 21816 
>> (imap) returned error 89
>>     
>
> ... Before
> the above mkdir() Dovecot should chdir() to user's home directory. So if
> LDAP returns user's home directory, I'd think the chdir() causes
> automount?
>
>   
There must be some sort of race condition happening here with 
automount.  I modified the code in mail-process.c to repeat the chdir 
(until CHDIR_TIMEOUT) until it succeeds, and it usually succeeds on the 
2nd try.

Eg (I've added some additional logging for debug):

May 14 16:21:04 testbed dovecot: [ID 667285 mail.info] try 0 of 
chdir(/home/adent)
May 14 16:21:04 testbed dovecot: [ID 107833 mail.info] imap-login: 
Login: user=<adent>, method=PLAIN, rip=xxx.xxx.xxx.242, 
lip=xxx.xxx.xxx.242, secured
May 14 16:21:04 testbed dovecot: [ID 791996 mail.info] chdir returned -1 
with errno 2
May 14 16:21:05 testbed dovecot: [ID 667285 mail.info] try 1 of 
chdir(/home/adent)
May 14 16:21:05 testbed dovecot: [ID 791996 mail.info] chdir returned 0
May 14 16:21:05 testbed dovecot: [ID 107833 mail.info] IMAP(adent): 
Disconnected: Logged out bytes=23/104

I still have no idea why this is happening.  A simple standalone C 
program with the alarm/setegid/seteuid/chdir bits (excerpted from the 
original mail-process.c ) works just fine.

-- 

Roy McMorran
Systems Administrator
MDI Biological Laboratory
mcmorran at mdibl.org



More information about the dovecot mailing list