Difference between revisions of "Dovecot"
(→Configuration: actually it was a comment, but yeah that way is better) |
|||
Line 9: | Line 9: | ||
==Create SSL certs== | ==Create SSL certs== | ||
− | + | The {{Pkg|dovecot}} package contains a script to create your SSL certificate and key. Before you run this script, create your settings file. | |
+ | |||
+ | {{bc| | ||
+ | cp /etc/ssl/dovecot-openssl.cnf{.sample,} | ||
+ | vim /etc/ssl/dovecot-openssl.cnf | ||
+ | }} | ||
+ | |||
+ | Then execute the script. | ||
+ | |||
+ | {{bc| | ||
+ | /usr/lib/dovecot/mkcert.sh | ||
+ | }} | ||
+ | |||
+ | The cert/key pair is created under /etc/ssl/certs and /etc/ssl/private. | ||
==Configuration== | ==Configuration== |
Revision as of 03:31, 9 December 2012
Dovecot is an IMAP and POP3 server.
The goal of this article is to setup dovecot, using PAM auth over SSL. It requires an SMTP server already working. You can follow the Sendmail guide to set up sendmail as your SMTP server.
Installation
Install the package dovecot and pam from the official repositories.
Create SSL certs
The dovecot package contains a script to create your SSL certificate and key. Before you run this script, create your settings file.
cp /etc/ssl/dovecot-openssl.cnf{.sample,} vim /etc/ssl/dovecot-openssl.cnf
Then execute the script.
/usr/lib/dovecot/mkcert.sh
The cert/key pair is created under /etc/ssl/certs and /etc/ssl/private.
Configuration
- Create the
/etc/pam.d/dovecot
file, and put the following:
auth required pam_unix.so nullok account required pam_unix.so
- Check the correct path where you mail is stored. Normally is
/var/spool/mail
. - Edit the
/etc/dovecot/dovecot.conf
. Be sure you set the path ofssl_cert
,ssl_key
andmail_location
correctly:
/etc/dovecot/dovecot.conf
listen = * disable_plaintext_auth=yes ssl = yes ssl_cert = </etc/ssl/certs/server.crt ssl_key = </etc/ssl/private/server.key mail_access_groups=mail mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u passdb { driver = pam } protocols = imap pop3 service auth { user = root } service imap-login { chroot = login user = dovecot } service pop3-login { chroot = login user = dovecot } userdb { driver = passwd }
- Change permissions for the
mail_location
directory:
chmod 0600 /var/spool/mail/*
Start the server
/etc/rc.d/dovecot start