Basic Configuration
===================

This page tells you the basics that you'll need to get a working Dovecot
installation.

Authentication
--------------

Here we're going to create a simple passwd-like file to make sure that the
authentication will work. Later when you know Dovecot is working, you can do it
differently. If you're going to use PAM and don't want to bother with this
step, you can skip over to PAM and SSL steps in<QuickConfiguration.txt>.

Run as your own non-root user:

---%<-------------------------------------------------------------------------
echo "$USER:{PLAIN}password" > passwd.dovecot
sudo mv passwd.dovecot /etc
---%<-------------------------------------------------------------------------

You can (and should) replace the "password" with whatever password you wish to
use, but don't use any important password here as we'll be logging in with
insecure plaintext authentication until SSL is configured.

Now, configure Dovecot to use the file by modifying 'dovecot.conf':

---%<-------------------------------------------------------------------------
auth default {
..
  passdb passwd-file {
    args = /etc/passwd.dovecot
  }
..
---%<-------------------------------------------------------------------------

Also comment out 'passdb pam' section so it's not tried to be used unneededly.

Plaintext Authentication
------------------------

Until SSL is configured, allow plaintext authentication. You probably want to
switch this back to "yes" afterwards.

If you didn't use the temporary passwd-file created above, don't do this if you
don't want your password to be sent in clear to network. Instead get SSL
configuration working and connect to Dovecot only using SSL.

---%<-------------------------------------------------------------------------
disable_plaintext_auth = no
---%<-------------------------------------------------------------------------

Mail Location
-------------

Set the 'mail_location' as instructed by <FindMailLocation.txt>.
('default_mail_env' in older Dovecot versions)

mbox
----

If you're using mboxes, it's important to have locking configuration correct.
See<MboxLocking.txt> for more information.

If you're using '/var/mail/' or '/var/spool/mail/' directory for INBOXes, you
may need to give Dovecot additional permissions so it can create dotlock files
there. A failure to do so will result in errors like these:

---%<-------------------------------------------------------------------------
open(/var/mail/.temp.host.1234.abcdefg) failed: Permission denied
file_lock_dotlock() failed with mbox file /var/mail/user: Permission denied
---%<-------------------------------------------------------------------------

From here on I'm assuming the INBOX directory is '/var/mail'.

First check what the permissions of '/var/mail' are:

---%<-------------------------------------------------------------------------
# ls -ld /var/mail
drwxrwxrwt 2 root mail 47 2006-01-07 20:44 /var/mail/
---%<-------------------------------------------------------------------------

In this case everyone has write access there and the directory is marked
sticky. This allows Dovecot to create the dotlock files, so you don't need to
do anything.

---%<-------------------------------------------------------------------------
# ls -ld /var/mail
drwxrwxr-- 2 root mail 47 2006-01-07 20:44 /var/mail/
---%<-------------------------------------------------------------------------

In this case only root and 'mail' group has write access to the directory.
You'll need to make Dovecot's mail processes part of this group by changing
'dovecot.conf':

---%<-------------------------------------------------------------------------
mail_extra_groups = mail
---%<-------------------------------------------------------------------------

Note that it has to be done this way. Adding 'dovecot' user to 'mail' group
doesn't help at all.

(This file was created from the wiki on 2007-04-13 14:32)
