[Dovecot] Double homedirs and tilde problems in case of chroot in passwd-file / static dbs.

Michal Soltys nozo at ziu.info
Wed Mar 21 14:42:48 EET 2007


Recently I've made the post about "double homedir" problem,
but I couldn't recreate it later. Here're the exact steps to
make it happen (configuration is at the bottom):

1) set configuration as below with passwd-files
2) clean testms dir (not necessary though)
3) reload dovecot (HUP is enough)
4) access the server with any client using testms user
    (make sure no other user accesses server before you)

- on the first access, dovecot will create
   /home/vmail/ppgk.com.pl/testms/Maildir under
   /home/vmail/ppgk.com.pl/testms/
- on every next access, dovecot will access (and create if
   it doesn't exist) proper Maildir under "single" home path

Situation will repeat itself, if dovecot is reloaded (or killed
and restarted). It happens to both imap and pop3.

Note, that the a single access seems to be enough to "fix"
the problem to all the other users in passwd-file, should
there be any.



The problem seems to be created by chroot specification in
passwd-file & static (and possibly when other dbs are used).

On the first access, dovecot attempts to recreate whole
/home/vmail.... directory structure *after* chrooting to the homedir
(or without taking earlier chroot into account), at least
that's how it looks from ktrace.

If I moved /./ to the left by one subdir, dovecot would attempt to do it
under root owned /home/vmail/ppgk.com.pl/ and fail in the process. And so
on.



Tilde is another problem - if in dovecot.userdb I change -

maildir:~/Maildir:
to
mbox:~/Mail:INBOX=~/inbox:

- then single '~' directory will be created under
/home/vmail/ppgk.com.pl/testms/, along the inbox file and Mail dir.

If INBOX, CONTROL and/or INDEX is specified explicitely in maildir
case, '~' won't be created. That leads to the questiom - is tilde
allowed in INBOX under mbox storage at all ?

I can't check '~' in INBOX/mbox case for system accounts atm though.


If you need any more info (like ktrace), let me know.


Configuration:

openbsd 3.9, i386, dovecot 1.0-rc27 (no post rc27 diffs)

dovecot.userdb:
testms::10000:10000:Test,,,:/home/vmail/ppgk.com.pl/testms/./::userdb_mail=maildir:~/Maildir:

dovecot.passdb:
testms:{PLAIN}test:

base_dir: /var/dovecot/
protocols: imap imaps pop3 pop3s
ssl_listen: *
ssl_ca_file: /etc/ssl/cert_bundle.pem
ssl_cert_file: /etc/ssl/ca_ppgk/certs/fetch_crt.pem
ssl_key_file: /etc/ssl/ca_ppgk/private/fetch_key.pem
verbose_ssl: yes
login_dir: /var/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
login_greeting: Dovecot IMAP server ready.
login_greeting_capability(default): yes
login_greeting_capability(imap): yes
login_greeting_capability(pop3): no
valid_chroot_dirs: /var/mail:/home/regular:/home/vmail
verbose_proctitle: yes
first_valid_uid: 1999
first_valid_gid: 10
mail_location: mbox:~/Mail:INBOX=/var/mail/%u
mail_debug: yes
fsync_disable: yes
lock_method: fcntl
maildir_copy_with_hardlinks: yes
mbox_read_locks: fcntl
mbox_write_locks: fcntl
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
imap_client_workarounds(default): outlook-idle delay-newmail
imap_client_workarounds(imap): outlook-idle delay-newmail
imap_client_workarounds(pop3): outlook-idle
pop3_uidl_format(default):
pop3_uidl_format(imap):
pop3_uidl_format(pop3): %08Xu%08Xv
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
   mechanisms: plain login
   verbose: yes
   debug: yes
   passdb:
     driver: passwd-file
     args: /etc/dovecot.passdb
   passdb:
     driver: bsdauth
   userdb:
     driver: passwd-file
     args: /etc/dovecot.userdb
   userdb:
     driver: passwd
   socket:
     type: listen
     client:
       path: /var/spool/postfix/private/auth
       mode: 432
       user: postfix
       group: postfix
     master:



More information about the dovecot mailing list