[Dovecot] Automounted home dirs not working
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@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@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 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?
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@mdibl.org
Roy McMorran wrote:
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
Timo Sirainen wrote: patches to my test machine and it seems to be resolved. Arrgh, I spoke too soon. It worked once right after the reboot. Now it's gone south again. Here's the same bit of truss output:
16016: setegid(1032) = 0 16016: seteuid(20025) = 0 16016: alarm(30) = 0 16016: chdir("/home/adent") Err#2 ENOENT 16016: alarm(0) = 30 16016: seteuid(0) = 0
I can't imagine why a simple chdir is failing. From the shell (on the same server) "cd /home/adent" works fine (i.e. the automount happens).
$ cd /home/adent $ df -k . Filesystem 1K-blocks Used Available Use% Mounted on jeltz:/vol/vol4/home/adent 1073741824 904942140 168799684 85% /home/adent
This is weird.
To answer your question Timo, these are all LDAP users. In truth I don't have any passwd users, but I could try creating a local test user.
Thanks for your help.
Best wishes, Roy
Roy McMorran Systems Administrator MDI Biological Laboratory mcmorran@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@mdibl.org
On May 14, 2008, at 11:52 PM, Roy McMorran wrote:
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.
But it never succeeds on first 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/104I 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.
If you enable more verbosity on automountd (-v -T?) does it correctly
log all the chdir attempts?
Anyway I've really no idea why it wouldn't work. Maybe try asking in
some Solaris forums/lists if they can think of some reason.
Timo Sirainen wrote:
But it never succeeds on first try?
Nope.
If you enable more verbosity on automountd (-v -T?) does it correctly log all the chdir attempts?
Anyway I've really no idea why it wouldn't work. Maybe try asking in some Solaris forums/lists if they can think of some reason.
I've concluded it is some problem with this particular server. I build Dovecot on another Solaris 10 box, and over there the chdir to an automounted home directory works as expected every time. I guess I'll reinstall the OS on my test server now :-(
It's definitely not a Dovecot problem, so sorry for the noise on the list. Thanks for all your help.
Cheers, -r
--
Roy McMorran Systems Administrator MDI Biological Laboratory mcmorran@mdibl.org
At 10:29 AM -0400 5/15/08, Roy McMorran wrote:
Timo Sirainen wrote:
But it never succeeds on first try?
Nope.
If you enable more verbosity on automountd (-v -T?) does it correctly log all the chdir attempts?
Anyway I've really no idea why it wouldn't work. Maybe try asking in some Solaris forums/lists if they can think of some reason.
I've concluded it is some problem with this particular server. I build Dovecot on another Solaris 10 box, and over there the chdir to an automounted home directory works as expected every time. I guess I'll reinstall the OS on my test server now :-(
It's definitely not a Dovecot problem, so sorry for the noise on the list. Thanks for all your help.
One thing you might want to look at before reinstalling completely is your NFS config on both sides and the controls resident in the network in between. With Solaris 10, you particularly want to make sure that your client system is not trying to use NFS over TCP across a network that interferes with it or to a server that doesn't support it properly. (for definitions of "properly" that are based in the behavior of Solaris 10 as a client...)
--
Bill Cole
bill@scconsult.com
participants (3)
-
Bill Cole
-
Roy McMorran
-
Timo Sirainen