Skip to content

Commit c4c29c3

Browse files
committed
Improved managesieve docs with regards to TLS
1 parent ccf013f commit c4c29c3

1 file changed

Lines changed: 35 additions & 11 deletions

File tree

docs/core/config/sieve/managesieve.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ ManageSieve protocol support in Dovecot is to add `sieve` to the
5252

5353
The managesieve daemon will listen on port 4190 by default.
5454

55+
### TLS Configuration
56+
57+
The ManageSieve network protocol can be used either:
58+
59+
1. unencrypted
60+
2. encrypted with opportunistic TLS (STARTTLS)
61+
3. encrypted with implicit TLS
62+
63+
Implicit TLS is the best practice because STARTTLS can be susceptible
64+
to downgrade attacks. To enable this, set `ssl = yes` in the
65+
`inet_listener sieve` section.
66+
5567
### Settings
5668

5769
As the implementation of the managesieve daemon is largely based on the
@@ -98,6 +110,7 @@ are shown.
98110
service managesieve-login {
99111
#inet_listener sieve {
100112
# port = 4190
113+
# ssl = yes
101114
#}
102115
103116
#inet_listener sieve_deprecated {
@@ -213,9 +226,9 @@ the direct error messages from the server without intermission of your
213226
client.
214227

215228
If you do not use TLS, you can connect using a simple `telnet`
216-
or `netcat` connection to the configured port (typically 4190 or 2000
217-
for older setups). Otherwise you must use a TLS-capable text protocol
218-
client like `gnutls-cli` as described below.
229+
or `netcat` connection to the configured port (typically 4190).
230+
Otherwise you must use a TLS-capable text protocol client like `openssl`
231+
or `gnutls-cli` as described below.
219232

220233
Upon connection, the server presents the initial greeting with its
221234
capabilities:
@@ -229,12 +242,13 @@ OK "Dovecot ready."
229242
```
230243

231244
Note that the reported `STARTTLS` capability means that the server
232-
accepts TLS, but, since you are using telnet/netcat, you cannot use this
233-
(refer to Manual TLS Login below). The `SASL` capability lists the
245+
accepts opportunistic TLS, but, since you are using telnet/netcat, you cannot use this
246+
(refer to Manual Opportunistic TLS Login below). The `SASL` capability lists the
234247
available SASL authentication mechanisms. If this list is empty and
235248
`STARTTLS` is available, it probably means that the server forces you
236-
to initiate TLS first (as dictated by [[setting,auth_allow_cleartext,yes]]
237-
in `dovecot.conf`).
249+
to initiate STARTTLS first (as dictated by [[setting,auth_allow_cleartext,yes]]
250+
in `dovecot.conf`). Note: if you're connecting from the same computer, the
251+
connection is considered secure and plaintext authentication is allowed!
238252

239253
Now you need to log in. Although potentially multiple SASL mechanisms
240254
are available, only `PLAIN` is described here. Authentication is
@@ -249,7 +263,7 @@ The credentials are the base64-encoded version of the string
249263
`"\0<username>\0<password"` (in which `\0` represents the ASCII NUL
250264
character). Generating this is cumbersome and a bit daunting for the
251265
novice user, so for convenience a
252-
[simple Perl script](http://pigeonhole.dovecot.org/utilities/sieve-auth-command.pl)
266+
[simple Perl script](https://pigeonhole.dovecot.org/utilities/sieve-auth-command.pl)
253267
is provided to generate the `AUTHENTICATE` command for you. It is used
254268
as follows:
255269

@@ -318,11 +332,21 @@ The symbolic link configured with the `sieve` setting should now point
318332
to the activated script in the sieve directory. If no script is
319333
active, this symbolic link is absent.
320334

321-
#### Manual TLS Login
335+
#### Manual Implicit TLS Login
336+
----------------
337+
338+
If you have enabled implicit TLS, you can use, for example, `openssl`
339+
to connect:
340+
341+
```
342+
openssl s_client -quiet -connect <host>:4190
343+
```
344+
345+
#### Manual Opportunistic TLS Login
322346
----------------
323347

324-
When TLS needs to be used during manual testing, `gnutls-cli` provides
325-
the means to do so. This command-line utility is part of the GNUTLS
348+
When opportunistic TLS needs to be used during manual testing, `gnutls-cli`
349+
provides the means to do so. This command-line utility is part of the GNUTLS
326350
distribution and on most systems this should be easy to install. It is
327351
used to connect to ManageSieve as follows:
328352

0 commit comments

Comments
 (0)