Dovecot: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
Created page with "= v1 = Check the following is set, or dovecot won't let people POP / IMAP in <pre> protocols = imap imaps pop3 pop3s </pre> We need to set it to listen on all interfaces, so ..."
 
No edit summary
Line 93: Line 93:


[http://wiki2.dovecot.org/Tools/Doveadm/Auth auth / passdb queries]
[http://wiki2.dovecot.org/Tools/Doveadm/Auth auth / passdb queries]
= after installation =
Logging:
<pre>
log_path = /var/log/mail/dovecot.err
info_log_path = /var/log/mail/dovecot.info
</pre>
<pre>
touch /var/log/mail/dovecot.err
touch /var/log/mail/dovecot.info
</pre>
in /etc/logrotate.d/rsyslog add
<pre>
/var/log/mail/dovecot.err
/var/log/mail/dovecot.info
</pre>
to the rest of the mail lines
Create a maildir for www-data manually (dovecot has no permissions to create in /var/www)
<pre>
mkdir /var/www/Maildir
chown www-data /var/www/Maildir
</pre>
To test:
<pre>
mutt -f imap://username@localhost
mutt -f pop://username@localhost
or to open a user's maildir:
mutt -m maildir -f ~user/Maildir
</pre>

Revision as of 14:47, 17 January 2013

v1

Check the following is set, or dovecot won't let people POP / IMAP in

protocols = imap imaps pop3 pop3s

We need to set it to listen on all interfaces, so uncomment

listen = *

Because we're allowing plaintext auth we need to change

disable_plaintext_auth = no

To set Dovecot to save files in Maildir format and then also use directories to store folders (instead of foldername.mail in one big folder), set NB the documentation says you should use an extra :layout=fs but that breaks just about everything and this way everything is put into subfolders starting with .

mail_location = maildir:~/Maildir

Ensure the following is set for performance

maildir_copy_with_hardlinks = yes

Because we're using NFS for mail storage we need to check:

mmap_disable = yes
dotlock_use_excl = yes # MUST CHECK THIS ONE
mail_nfs_storage = yes
mail_nfs_index = yes

v2

apt-get -t squeeze-backports --no-install-recommends install dovecot-common dovecot-core dovecot-imapd dovecot-pop3d


in /etc/dovecot/dovecot.conf

listen = *, ::
base_dir = /var/run/dovecot/

in /etc/dovecot/conf.d/

10-auth.conf

disable_plaintext_auth = no

10-logging.conf

log_path = /var/log/mail/dovecot.err
info_log_path = /var/log/mail/dovecot.info

10-mail.conf

mail_location = maildir:~/Maildir
mmap_disable = yes
dotlock_use_excl = yes
mail_fsync = always
mail_nfs_storage = yes
mail_nfs_index = yes
maildir_copy_with_hardlinks = yes

authenticating using an external server

auth-system-conf.ext

This allows you to authenticate a user from a remote IMAP server

passdb {
  driver = imap
  args = host=192.168.0.112
}

But you still need the UID / GID etc, so you need to find a way to get it to read the userdb, so also add

userdb {
  driver = passwd-file
  args = /etc/dovecotauth/passwd
}

and link /etc/dovecotauth/passwd from the other server using NFS

You need at lease one passdb and one userdb. If you have more than each, dovecot runs through them in that order.

Use the doveadm command to administer and test. Useful are:

user / userdb queries

auth / passdb queries

after installation

Logging:

log_path = /var/log/mail/dovecot.err
info_log_path = /var/log/mail/dovecot.info
touch /var/log/mail/dovecot.err
touch /var/log/mail/dovecot.info

in /etc/logrotate.d/rsyslog add

/var/log/mail/dovecot.err
/var/log/mail/dovecot.info

to the rest of the mail lines

Create a maildir for www-data manually (dovecot has no permissions to create in /var/www)

mkdir /var/www/Maildir
chown www-data /var/www/Maildir

To test:

mutt -f imap://username@localhost
mutt -f pop://username@localhost

or to open a user's maildir:
mutt -m maildir -f ~user/Maildir