In our environment home directories are auto-mounted via /home/<user> including on the server provided mail. Within the various mail services though we try to isolate and override with local /mail/home/<user> Works well except that dovecot still wants to cd to the real home triggering a useless and potentially hindering automount when it invokes the imap or pop3 process specified by mail_executable, ie an lsof of the process shows cwd of /home/<user> and the automounted home. It does this even though home is properly overridden within. I suspect this is part of changing to invoke as the user as the *-login process are ok but then they are still running as dovecot. Various recent attempts to explicitly respecify HOME for mail_executable via a wrapper script or using env have been to no avail (as seen below). How can I resolve? And no I don't just want to override /home at the system level. Thanks -- Gary # 1.0.9: /etc/dovecot.conf base_dir: /var/run/dovecot/ syslog_facility: local1 protocols: imap imaps pop3 pop3s listen(default): *:143 listen(imap): *:143 listen(pop3): *:110 ssl_listen(default): *:993 ssl_listen(imap): *:993 ssl_listen(pop3): *:995 ssl_ca_file: /etc/ssl/certs/gd_bundle.crt ssl_cert_file: /etc/ssl/certs/engr.uvic.ca.crt ssl_key_file: /etc/ssl/private/engineeringwildcard.key ssl_parameters_regenerate: 24 disable_plaintext_auth: no login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login login_log_format_elements: %u [%r] %c login_process_size: 32 login_processes_count: 8 login_max_processes_count: 150 verbose_proctitle: yes first_valid_uid: 100 default_mail_env: mbox:/mail/home/%u/mail/:INBOX=/mail/boxes/%u:INDEX=/mail/indexes/%u mail_location: mbox:/mail/home/%u/mail/:INBOX=/mail/boxes/%u:INDEX=/mail/indexes/%u mbox_read_locks: fcntl dotlock mbox_write_locks: fcntl dotlock mail_executable(default): /bin/env 'HOME=/mail/home/$USER' /usr/libexec/dovecot/imap mail_executable(imap): /bin/env 'HOME=/mail/home/$USER' /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3-home mail_plugin_dir(default): /usr/lib/dovecot/imap mail_plugin_dir(imap): /usr/lib/dovecot/imap mail_plugin_dir(pop3): /usr/lib/dovecot/pop3 imap_client_workarounds(default): delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep imap_client_workarounds(imap): delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep imap_client_workarounds(pop3): outlook-idle pop3_uidl_format(default): pop3_uidl_format(imap): pop3_uidl_format(pop3): %v.%u pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): oe-ns-eoh outlook-no-nuls auth default: passdb: driver: pam userdb: driver: passwd args: home=/mail/home/%u plugin: home: /mail/home/%u
Timo Sirainen
2011-May-19 19:23 UTC
[Dovecot] How to stop mail_executable from cwd to ~home
On Wed, 2011-05-18 at 17:45 -0700, Gary Duncan wrote:> Works well except that dovecot still wants to cd to the real home > triggering a useless and potentially hindering automount > when it invokes the imap or pop3 process specified by mail_executable, > ie an lsof of the process shows cwd of /home/<user> and the automounted home. > > How can I resolve? > # 1.0.9: /etc/dovecot.conf..> userdb: > driver: passwd > args: home=/mail/home/%uUpgrade to v1.1+ and this home setting will actually work.
Gary Duncan <gduncan at engr.UVic.CA> writes:> In our environment home directories are auto-mounted via /home/<user> > including on the server provided mail. > Within the various mail services though we try to isolate > and override with local /mail/home/<user> > > Works well except that dovecot still wants to cd to the real home > triggering a useless and potentially hindering automountThis becomes really apparent if you have an organization wide-mailing list, and one delivery to it causes a flurry of automounts. I similarly replace per-user mounts with a home mount bundle.> when it invokes the imap or pop3 process specified by mail_executable, > ie an lsof of the process shows cwd of /home/<user> and the automounted home.I see the same behaviour in 2.0.13, which process tracing of imap shows more clearly (/nfs/user is per user mount, /nfs/home/user is user home bundle) ... 4087: getuid() = 12345 [12345] 4087: chdir("/nfs/test") = 0 4087: stat64("/nfs/home/test/mail", 0xFFBFF6C0) = 0 4087: stat64("/nfs/home/test/mail", 0xFFBFF5A0) = 0 4087: stat64("/nfs/home/test/mail", 0xFFBFF6C0) = 0 ... This happens fairly early after imap-login forks and execs the imap process. I'll see if I can find it after building a debug version, but I think Timo will beat me to this. Joseph Tam <jtam.home at gmail.com>
Timo wrote:>> As to how to stop the mail process from chdir'ing to a home directory > > If you don't want Dovecot to use a home directory, don't tell it a home directory.I'm all for that since I don't seem to have any need for a home directory. Any idea of how to do it with a passwd-file userdb backend? I also tried to override home directory with userdb { driver = passwd-file args = /etc/passwd home=/bundled/home/$n } but that didn't work out too well. Or is this feature a rephrasing of the current topic thread "Global fields for passwd-file database". Joseph Tam <jtam.home at gmail.com>