Difference between revisions of "Dovecot"

From ArchWiki
Jump to: navigation, search
(Configuration: changed bc to hc since the first line is the configuration file)
Line 19: Line 19:
 
* Check the correct path where you mail is stored. Normally is {{ic|/var/spool/mail}}.
 
* Check the correct path where you mail is stored. Normally is {{ic|/var/spool/mail}}.
 
* Edit the {{ic|/etc/dovecot/dovecot.conf}}. Be sure you set the path of {{ic|ssl_cert}}, {{ic|ssl_key}} and {{ic|mail_location}} correctly:
 
* Edit the {{ic|/etc/dovecot/dovecot.conf}}. Be sure you set the path of {{ic|ssl_cert}}, {{ic|ssl_key}} and {{ic|mail_location}} correctly:
{{bc|<nowiki>
+
{{hc|# 2.1.9: /etc/dovecot/dovecot.conf|<nowiki>
# 2.1.9: /etc/dovecot/dovecot.conf
+
 
listen = *
 
listen = *
 
disable_plaintext_auth=yes
 
disable_plaintext_auth=yes
Line 50: Line 49:
 
* Change permissions for the {{ic|mail_location}} directory:
 
* Change permissions for the {{ic|mail_location}} directory:
 
{{bc|chmod 0600 /var/spool/mail/*}}
 
{{bc|chmod 0600 /var/spool/mail/*}}
 +
 
==Start the server==
 
==Start the server==
 
{{bc|/etc/rc.d/dovecot start}}
 
{{bc|/etc/rc.d/dovecot start}}

Revision as of 15:24, 29 August 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

In the SSL_certs subsection of the SOHO postfix article, you can read steps to create the ssl certs

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 of ssl_cert, ssl_key and mail_location correctly:
# 2.1.9: /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