This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.
Differences between revisions 1 and 25 (spanning 24 versions)
Revision 1 as of 2006-01-07 21:31:13
Size: 3962
Editor: TimoSirainen
Comment:
Revision 25 as of 2018-06-20 22:57:32
Size: 5935
Editor: S010610bf48919d24
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[[TableOfContents]] <<TableOfContents>>

For testing POP3 installation, see TestPop3Installation.
Line 4: Line 6:

First check with `ps` that `dovecot` process is actually running. If it's not, you had an error in `dovecot.conf` and the error message was written to log. Go back to RunningDovecot and [wiki:Logging Logging] if you can't find it.
First check with `ps` that `dovecot` process is actually running. If it's not, you had an error in `dovecot.conf` and the error message was written to log. Go back to RunningDovecot and [[Logging]] if you can't find it.
Line 8: Line 9:
Line 16: Line 16:
* OK Dovecot ready. * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN] Dovecot ready.
Line 19: Line 19:
If you got "connection refused", check that `imap` is included in `protocols` setting in `dovecot.conf`. Also check that `listen` setting is `*`. If you got "connection refused", make sure that Dovecot is configured to serve the imap protocol and listening on the expected interfaces/addresses.
The simplest way to do that would be using [[Tools/Doveconf|doveconf(1)]]:

{{{
# doveconf protocols listen
protocols = imap pop3 lmtp sieve
listen = *, ::
}}}

If the protocols setting shouldn't contain `imap` so add it. Also make sure, that relevant `!include` or `!include_try` configuration lines are not commented.
Line 24: Line 34:
# telnet your.host.org 143 # telnet imap.example.com 143
Line 26: Line 36:
Connected to your.host.org. Connected to imap.example.com.
Line 28: Line 38:
* OK Dovecot ready. * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN] Dovecot ready.
Line 30: Line 40:
Line 33: Line 42:
If you have only imaps enabled, see "remote login" section below for how to test using openssl s_client.
Line 34: Line 45:
{{{
# telnet localhost 143
a login "username" "password"
}}}
Replace the username and password with the ones you added to `passwd.dovecot` in BasicConfiguration. Note that all IMAP commands begin with a tag, which is basically any string you want, but it must be there. So don't leave out the "a" in the above example. If the password contains '"' character, escape it with '\' (e.g. {{{"foo\"bar"}}}).

You should get an "a OK Logged in." reply. If you get "Authentication failed" error, set `auth_verbose = yes` and `auth_debug = yes` in `dovecot.conf`, restart Dovecot and try again. The log file should now show enough information to help you fix the problem.

== Check that it's allowing remote logins ==
You'll need to try this from another computer, since all local IPs are treated as secure:
Line 36: Line 57:
# telnet localhost 143
1 login username password
# telnet imap.example.com 143
a login "username" "password"
Line 39: Line 60:
If the connection is hanging instead of giving {{{* Dovecot ready}}}, you have a firewall that's preventing the connections.
Line 40: Line 62:
Replace the username and password with the ones you added to `passwd.dovecot` in BasicConfiguration.

You should get an "1 OK Logged in." reply. If you get "Authentication failed" error, set `auth_verbose = yes` and `auth_debug = yes` in `dovecot.conf`, restart Dovecot and try again. The log file should now show enough information to help you fix the problem.

== Check that it's allowing remote logins ==

{{{
# telnet your.host.org 143
1 login username password
}}}

The only difference here compared to step above is that you might get:
Otherwise, the only difference here compared to step above is that you might get:
Line 55: Line 66:
x NO Plaintext authentication disabled. a NO Plaintext authentication disabled.
Line 57: Line 68:
If this is the case, you didn't set `disable_plaintext_auth = no`. You could alternatively use OpenSSL to test that the server works with SSL:
Line 58: Line 70:
If this is the case, you didn't set `disable_plaintext_auth = no`. You could alternatively use OpenSSL to test that the server works with SSL (assuming you've already set it up):

{{{
# openssl s_client -connect your.host.org:993
 * Test using imaps port (assuming you haven't disabled imaps port):
 {{{
# openssl s_client -connect imap.example.com:993
* OK Dovecot ready.
}}}
 * Test using imap port and STARTTLS command (works also with imap port):
 {{{
# openssl s_client -connect imap.example.com:143 -starttls imap
Line 66: Line 82:
Line 70: Line 85:
2 select inbox b select inbox
Line 77: Line 92:
2 OK [READ-WRITE] Select completed. b OK [READ-WRITE] Select completed.
Line 79: Line 94:
Line 82: Line 96:
If anything goes wrong, set `mail_debug = yes` and try again. The log file should now contain debugging information of where Dovecot is trying to find the mails. Fix `default_mail_env` setting and try again. If anything goes wrong, set `mail_debug = yes` and try again. The log file should now contain debugging information of where Dovecot is trying to find the mails. Fix `mail_location` setting and try again.
Line 85: Line 99:
Line 89: Line 102:
2 list "" * c list "" *
Line 92: Line 105:
x OK List completed. c OK List completed.
}}}
If they weren't found, set `mail_debug = yes` and look at the debugging information. Fix `mail_location` setting and try again.

== Check out some other IMAP commands ==

If you already have some emails, you can try reading them:

{{{
1 SELECT INBOX
2 FETCH 1:* (FLAGS INTERNALDATE BODY.PEEK[HEADER.FIELDS (SUBJECT)])
3 FETCH 1 BODY[TEXT]
}}}
{{{1:*}}} means all messages

You can also try moving a mail to Trash:
{{{
4 CREATE Trash
5 COPY 1 Trash
6 STORE 1 +FLAGS \Deleted
7 EXPUNGE
Line 95: Line 128:
If they weren't found, set `mail_debug = yes` and look at the debugging information. Fix `default_mail_env` setting and try again.
Line 98: Line 129:
Line 109: Line 139:
 * Check if client is configured to show only "subscribed mailboxes". If so, you'll have to subscribe to the mailboxes you wish to see.  * Check if client is configured to show only "subscribed mailboxes". If so, you'll have to subscribe to the mailboxes you wish to see. You can see a list of subscribed mailboxes with:
 {{{
d lsub "" *
* LSUB () "/" "INBOX"
d OK Lsub completed.
}}}
Line 112: Line 147:

== Make a graceful exit ==
To close the connection to Dovecot issue a logout:
{{{
e logout
* BYE Logging out
e OK Logout completed.
}}}

For testing POP3 installation, see TestPop3Installation.

Check that it's running

First check with ps that dovecot process is actually running. If it's not, you had an error in dovecot.conf and the error message was written to log. Go back to RunningDovecot and Logging if you can't find it.

Check that it's listening

Next check that Dovecot is listening for connections:

# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN] Dovecot ready.

If you got "connection refused", make sure that Dovecot is configured to serve the imap protocol and listening on the expected interfaces/addresses. The simplest way to do that would be using doveconf(1):

# doveconf protocols listen
protocols = imap pop3 lmtp sieve
listen = *, ::

If the protocols setting shouldn't contain imap so add it. Also make sure, that relevant !include or !include_try configuration lines are not commented.

Next check that it also works from remote host:

# telnet imap.example.com 143
Trying 1.2.3.4...
Connected to imap.example.com.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN] Dovecot ready.

If that didn't work, check all possible firewalls in between, and check that listen setting is * in dovecot.conf.

If you have only imaps enabled, see "remote login" section below for how to test using openssl s_client.

Check that it's allowing logins

# telnet localhost 143
a login "username" "password"

Replace the username and password with the ones you added to passwd.dovecot in BasicConfiguration. Note that all IMAP commands begin with a tag, which is basically any string you want, but it must be there. So don't leave out the "a" in the above example. If the password contains '"' character, escape it with '\' (e.g. "foo\"bar").

You should get an "a OK Logged in." reply. If you get "Authentication failed" error, set auth_verbose = yes and auth_debug = yes in dovecot.conf, restart Dovecot and try again. The log file should now show enough information to help you fix the problem.

Check that it's allowing remote logins

You'll need to try this from another computer, since all local IPs are treated as secure:

# telnet imap.example.com 143
a login "username" "password"

If the connection is hanging instead of giving * Dovecot ready, you have a firewall that's preventing the connections.

Otherwise, the only difference here compared to step above is that you might get:

* BAD [ALERT] Plaintext authentication is disabled, but your client sent password in plaintext anyway. If anyone was listening, the password was exposed.
a NO Plaintext authentication disabled.

If this is the case, you didn't set disable_plaintext_auth = no. You could alternatively use OpenSSL to test that the server works with SSL:

  • Test using imaps port (assuming you haven't disabled imaps port):
    # openssl s_client -connect imap.example.com:993
    * OK Dovecot ready.
  • Test using imap port and STARTTLS command (works also with imap port):
    # openssl s_client -connect imap.example.com:143 -starttls imap
    * OK Dovecot ready.

Check that it finds INBOX

After logging in, check that the INBOX is found:

b select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 1 EXISTS
* 1 RECENT
* OK [UIDVALIDITY 1106186941] UIDs valid
* OK [UIDNEXT 2] Predicted next UID
b OK [READ-WRITE] Select completed.

It should contain the mail that you sent to yourself in FindMailLocation step.

If anything goes wrong, set mail_debug = yes and try again. The log file should now contain debugging information of where Dovecot is trying to find the mails. Fix mail_location setting and try again.

Check that it finds other mailboxes

If you already have other mailboxes created, you can check that Dovecot finds them:

c list "" *
* LIST (\NoInferiors) "/" "test"
* LIST (\NoInferiors) "/" "INBOX"
c OK List completed.

If they weren't found, set mail_debug = yes and look at the debugging information. Fix mail_location setting and try again.

Check out some other IMAP commands

If you already have some emails, you can try reading them:

1 SELECT INBOX
2 FETCH 1:* (FLAGS INTERNALDATE BODY.PEEK[HEADER.FIELDS (SUBJECT)])
3 FETCH 1 BODY[TEXT]

1:* means all messages

You can also try moving a mail to Trash:

4 CREATE Trash
5 COPY 1 Trash
6 STORE 1 +FLAGS \Deleted
7 EXPUNGE

Check that real mail clients work

Since mail clients can be configured in various ways, please check first if the problem is with Dovecot configuration or with the client's configuration. You can rule out it being Dovecot's problem with the "telnet" methods described above.

If you can't log in,

  • Make sure SSL/TLS settings are correct.
  • Make sure the client uses plaintext authentication method, unless you've specifically configured Dovecot to accept others.

If you can see only INBOX,

  • Clear out any "IMAP namespace prefix" or similar settings from clients.
  • Check if client is configured to show only "subscribed mailboxes". If so, you'll have to subscribe to the mailboxes you wish to see. You can see a list of subscribed mailboxes with:
    d lsub "" *
    * LSUB () "/" "INBOX"
    d OK Lsub completed.

Most IMAP clients have been tested with Dovecot and they work.

Make a graceful exit

To close the connection to Dovecot issue a logout:

e logout
* BYE Logging out
e OK Logout completed.

None: TestInstallation (last edited 2020-01-02 18:15:18 by 67)