This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.

Home Directories for Virtual Users

Home directory is a per-user directory where Dovecot can save user-specific files.

And in particular:

Some uses for home directory are:

Home vs. mail directory

Home directory shouldn't be the same as mail directory with mbox or Maildir formats (but with dbox/obox it's fine). It's possible to do that, but you might run into trouble with it sooner or later. Some problems with this are:

Ways to set up home directory

The directory layouts for home and mail directories could look like one of these (in the preferred order):

  1. Mail directory under home, for example: home=/var/vmail/domain/user/ mail=/var/vmail/domain/user/mail/

  2. Completely distinct home and mail directories: home=/home/virtual/domain/user/ mail=/var/vmail/domain/user/

  3. Home directory under mail, for example:
    • Maildir: home=/var/vmail/domain/user/home/ mail=/var/vmail/domain/user/

    • mbox: There's really no good and safe way to do it.
  4. The home directory is the same as the mail directory.

If for example home=/var/vmail/domain/user/ mail=/var/vmail/domain/user/mail/, set:

mail_home = /var/vmail/%d/%n
mail_location = maildir:~/mail

Examples

LDAP with relative directory paths

If your LDAP database uses e.g. mailDirectory = domain/user/, you can use it as a base for home directory:

user_attrs = .., mailDirectory=home=/var/vmail/%$

Then just use mail_location = maildir:~/Maildir.

VirtualUsers/Home (last edited 2016-06-07 00:14:39 by TimoSirainen)