I'm testing Dovecot as a possible replacement for UW. In my environment the home directories are automounted via NFS from a NetApp. In general this works fine, 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 (if however I make sure that /home/adent is mounted at the server (eg. cd /home/adent) prior to starting the mail client this error does not occur) Why isn't the automount succeeding? This is Dovecot Version 1.0.13. I'm running under Solaris 10. Thanks! Roy PS: [root at testbed][ /var/log ]# dovecot -n # 1.0.13: /etc/dovecot.conf base_dir: /var/run/dovecot/ protocols: imap imaps pop3 pop3s ssl_cert_file: /etc/ssl/certs/imapd.pem ssl_key_file: /etc/ssl/private/imapd.pem disable_plaintext_auth: no login_dir: /var/run/dovecot/login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(pop3): /usr/local/libexec/dovecot/pop3-login verbose_proctitle: yes mail_privileged_group: mail mail_location: mbox:~/Mail:INBOX=/var/mail/%u mmap_disable: yes dotlock_use_excl: yes mail_executable(default): /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/imap mail_executable(pop3): /usr/local/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3 pop3_uidl_format(default): pop3_uidl_format(imap): pop3_uidl_format(pop3): %08Xv%08Xu auth default: mechanisms: plain login passdb: driver: pam passdb: driver: ldap args: /etc/dovecot-ldap.conf userdb: driver: passwd userdb: driver: ldap args: /etc/dovecot-ldap.conf -- Roy McMorran Systems Administrator MDI Biological Laboratory mcmorran at mdibl.org
On Mon, 2008-05-12 at 10:46 -0400, Roy McMorran wrote:> I'm testing Dovecot as a possible replacement for UW. In my environment > the home directories are automounted via NFS from a NetApp. In general > this works fine, 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 89Does this happen only for your LDAP users or also passwd users? 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? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20080512/919724c4/attachment-0002.bin>
Timo Sirainen wrote:> On Mon, 2008-05-12 at 10:46 -0400, Roy McMorran wrote: > >> 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 >> > > Does this happen only for your LDAP users or also passwd users? 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? > >This seems to have been a Solaris issue. I've applied some recent patches to my test machine and it seems to be resolved. You're right Timo about the chdir - I ran a truss and that was where it was initially failing (with ENOENT). Now it works: ... 6983: seteuid(20025) = 0 6983: alarm(30) = 0 6983: chdir("/home/adent") = 0 6983: alarm(0) = 30 6983: seteuid(0) = 0 ... Thanks for the help! Cheers, -- Roy McMorran Systems Administrator MDI Biological Laboratory mcmorran at mdibl.org
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