This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.
Differences between revisions 5 and 6
Revision 5 as of 2005-09-06 06:41:04
Size: 2574
Editor: 212-193-125
Comment: spam cleaning
Revision 6 as of 2005-10-01 09:46:16
Size: 3045
Editor: TimoSirainen
Comment:
Deletions are marked like this. Additions are marked like this.
Line 82: Line 82:
I have no plans to support INBOX-only IMAP. If you only need POP3, you might then as well use another POP3 server. Dovecot isn't anything special as a POP3 server. If you '''really''' want to use Dovecot as a plain POP3 server without index files, you can work around the problem of not having the per-user directory:

 * Set users' home directory to `/tmp` in userdb
 * Modify `default_mail_env` setting so that the mail root directory is also `/tmp` and append `:INDEX=MEMORY` to it. For example: `default_mail_env = mbox:/tmp:INBOX=/var/mail/%u:INDEX=MEMORY`
 * Make sure that the users don't have IMAP access, or they can start writing to `/tmp' and accidentally share mail with others users

Instead of `/tmp' directory you can use some other non-writable directory which could be safer.

Mail location

In configuration file the default mail location is set using default_mail_env setting.

You can use some variables in the value:

  • %u - full username
  • %n - user part in user@domain, same as %u if there's no domain
  • %d - domain part in user@domain, empty if there's no domain
  • %h - home directory

In 1.0-test versions there are more, see [wiki:Variables Variables].

Typically with maildir this would be set to:

default_mail_env = maildir:%h/Maildir

or with mbox:

default_mail_env = mbox:%h/mail:INBOX=/var/mail/%u

Index files are by default stored under the same directory as mails. With maildir they are stored in the actual maildirs, with mbox they are stored under .imap/ directory. You can change these by adding :INDEX=location to location string. For example:

default_mail_env = mbox:%h/mail:INBOX=/var/mail/%u:INDEX=%h/indexes

If you didn't set home directory, %h can't be used. Instead you can do something like:

default_mail_env = maildir:/home/%u/Maildir

With virtual users the mail and home directories are probably the same. In that case you would just do:

default_mail_env = maildir:%h

Per-user mail locations

It's possible to override default_mail_env for specific users in authentication userdb.

SQL

Return mail field in user_query, for example:

user_query = SELECT home, uid, gid, mail FROM users WHERE user = '%u'

LDAP

Specify mail attribute in user_attrs, for example:

user_attrs = uid,homeDirectory,mailLocation,,uidNumber,gidNumber

passwd-file

The mail attribute is set as last field in passwd-file, for example:

user:{PLAIN}password:1000:1000::/home/user:/bin/false::mbox:%h/mail:INBOX=/var/mail/%u

Mixing mbox and maildir

With 1.0-tests it's possible to use both mboxes and maildirs for same user with namespaces. See [wiki:Namespaces Namespaces].

Having mixed mbox/maildirs within same namespace isn't currently supported.

Only /var/mail mboxes

With POP3 it's been traditional that users have their mails only in /var/mail directory. IMAP however supports having multiple mailboxes, so each user has to have a private directory where the mailboxes are stored. Dovecot also needs a directory for its indexes unless you disable them completely.

If you really want to use Dovecot as a plain POP3 server without index files, you can work around the problem of not having the per-user directory:

  • Set users' home directory to /tmp in userdb

  • Modify default_mail_env setting so that the mail root directory is also /tmp and append :INDEX=MEMORY to it. For example: default_mail_env = mbox:/tmp:INBOX=/var/mail/%u:INDEX=MEMORY

  • Make sure that the users don't have IMAP access, or they can start writing to `/tmp' and accidentally share mail with others users

Instead of `/tmp' directory you can use some other non-writable directory which could be safer.

None: MailLocation (last edited 2019-09-11 14:05:46 by MichaelSlusarz)