Dovecot/Install

Introduction
This article will show you how to install Dovecot for use with some mail servers. You may also want to see other mail server articles for more specific setups. This article uses Dovecot 1.0.

Installation
This setup will provide a IMAP server, both as regular and secure. Add the following entry to :

If you need a SSL-encrypted IMAP server, you first need to ensure that you have Dovecot compiled with SSL support. For this to happen, Dovecot needs to be compiled with the USE flag.

Add the following to :

Install Dovecot using:

Enable the USE flag for Dovecot if you want an immediate notification of new mails in your mailbox (IDLE support) for your mail clients.

Configure Dovecot by executing:

Configuration
The following configuration is found in. To ensure that no other users can access your Dovecot configuration where the key is stored, run:

The default value Dovecot listens on is [::]. If you are experiencing that you cannot access your mail server and the port is not used, it might help to change the value of listen to *.

Protocols
In the first section of the file, you need to specify the protocols that you want enabled. You probably have one or both of "imap" or "pop3" already enabled. You need to add the secure version of the protocols you use to this list. For example, if you use both, this would be:

To enable IMAP:

To use IMAPS:

See Dovecot TLS for how to create SSL certificates for Dovecot. To use POP3, add pop3 to the protocols variable. If you would like to use POP3 with SSL (POP3S), add pop3s.

Location for mailbox
Set the mail_location variable:

Using MySQL authorization
The following are sample configurations for Dovecot. Again, note that you'll need to substitute in the correct UID and GID values.

Using vpopmail Authorization
Please see this qmail-howto for information on using Dovecot with.

Debugging
These settings may also be desirable:

Logging
If you do not want Dovecot to log to the syslog, you can specify a log path:

The error messages will go to file specified by log_path, while everything else goes to info_log_path. If you do this, make sure you are really looking at the log_path file for error messages, since the "Starting up" message is written to info_log_path file.

logrotate
If you have logrotate installed, you can use this script to rotate your logs. Note, that it requires you to have changed from syslog to an external log file. Save the below script as :

Starting the Server
This will add Dovecot to the default runlevel:

You can start Dovecot with:

Troubleshooting
Make sure you see the Dovecot starting up message in your log file. Try logging in with telnet (in the package):

It should reply with the * OK Dovecot ready. message. If not, it is not running for some reason. Probably some configuration mistake, see log file for errors. Try to log in with login user@domain.tld your_password. You should see the x OK Logged in. message. If not, the authentication failed for some reason. You will find the error in. To logout, enter logout.

Dovecot/Installation