Hello all:
For several years I have been running the following in a Linux server.
Dovecot Version: 2.0.9
*IMAP:* Connection Security: SSL/TLS Port: 993 Authentication Method: Normal Password
*SMTP:* Connection Security: STARTTLS Port: 587 Authentication Method: Normal Password
The E-mail client is Thunderbird on Windows.
I am preparing a new server, with Dovecot 2.2.36 and would like to know the currently recommended protocols. Should I stick to what I have? I would prefer to start with the easiest configuration possible, which I will revise later.
This is the command that I have been using to verify the server's functionality:
% openssl s_client -connect localhost:imaps
TIA
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Greetings,
On Mon, 2020-11-09 at 23:42 -0600, Raymond Herrera wrote:
For several years I have been running the following in a Linux server.
Dovecot Version: 2.0.9
*IMAP:* Connection Security: SSL/TLS Port: 993 Authentication Method: Normal Password
*SMTP:* Connection Security: STARTTLS Port: 587 Authentication Method: Normal Password
Pretty standard setup.
Personally I am using Postfix for SMTP/Submission and Dovecot for IMAP
- both with STARTTLS. I use a couple of MX's to actually do the initial recieving of email, so everything auth related (and adress related) is in a multi-master LDAP server on each machine. Using Dovetcot-SASL for SMTP auth too.
The E-mail client is Thunderbird on Windows.
I my experience pretty much any client works with this setup.
Nikolai Lusan nikolai@lusan.id.au -----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEVfd4GW6z4nsBxdLo4ZaDRV2VL6QFAl+qKq4ACgkQ4ZaDRV2V L6TjxQ/+Kp2gNY3p9GdXEc0rc3cRH1ceEpenegg2JEHCQ31TRO/gchlKV3+peVZR VK6HNukNXq+bIWNMe/tN1ow/8gEn17TFtOe4+kVKnkFfAb2RpqaXEWVGm+NSyVZG yQQizq4t1c83oZV91v3+9A8MVOcKfRQ7nBgqiK1KrK+us/pGBap1Q9vxxdp2EKY2 kFqKdhl/AQUAPEcFdH1flnKha5reA4MzbVPp3jemyRZcDDYuAFMf85tv5uQTJKkc bBmWo0buknxczBCZcyfcc9K6MPerHVSM6Z1dgLzbM3j/t+Le2jWYZDtSsBEc+HgY sBI/8NGtv0vA2GnHnuXus+wWoJ7Uya/xYIPW2imnP1bK8P3GwT5R7Z0gNmMyJl0A bKVNaT4lpJI2VxnhUe2WUwEXSWdUU2NTRrg1a+pXcVuwI7ej0KefDgfjy8ERGzkp /bJ+8kE2ZwpFx5+V+H+hRYB9Ik7MZkKTyIYqf/2/srveJB8zmuhPZUpE6qZyFESW lI8Hg/Rjp884Y5p+Regel5lzWiqlCdfj7lz1gJqgjuMWx2rfJyIzUBeIuWO6oj+W 9kpk3EyaQ37/2DPSh9xwp/GMocN4Ey8GPjYhXn+pokRGryPN48sx1tywiAtPa9gQ yiVR82ZMQxsuqAhNzW21tViRukkESeEj/WNEG4vPje/3KxOWpKg= =AT+Y -----END PGP SIGNATURE-----
On 10/11/20 1:52 pm, Nikolai Lusan wrote:
Greetings,
On Mon, 2020-11-09 at 23:42 -0600, Raymond Herrera wrote:
For several years I have been running the following in a Linux server.
Dovecot Version: 2.0.9
*IMAP:* Connection Security: SSL/TLS Port: 993 Authentication Method: Normal Password
*SMTP:* Connection Security: STARTTLS Port: 587 Authentication Method: Normal Password
Pretty standard setup.
Personally I am using Postfix for SMTP/Submission and Dovecot for IMAP
- both with STARTTLS. I use a couple of MX's to actually do the initial recieving of email, so everything auth related (and adress related) is in a multi-master LDAP server on each machine. Using Dovetcot-SASL for SMTP auth too.
The E-mail client is Thunderbird on Windows.
I my experience pretty much any client works with this setup.
I also use STARTTLS, though I expose that on both IMAP and IMAPS ports, which is consistent with a number of major imap providers.
Selection of ciphers is important. I researched this recently and use this stanza in the configuration
ssl = required ssl_min_protocol = TLSv1.2 ssl_cipher_list = EECDH+AESGCM:EDH+AESGCM ssl_prefer_server_ciphers = yes
The defaults in dovecot are shown commented in conf.d/10-ssl.conf. They are not best practice for security.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On Tue, 2020-11-10 at 14:05 +0800, Jeremy Ardley wrote:
I also use STARTTLS, though I expose that on both IMAP and IMAPS ports, which is consistent with a number of major imap providers.
Yeah, the choice to use only STARTTLS over IMAP only (no IMAPS) was mine. I do force TLS though, generally it makes it easier for me to handout instructions for people to connect to the server (I host email for a few different organisations).
Selection of ciphers is important. I researched this recently and use this stanza in the configuration
ssl = required ssl_min_protocol = TLSv1.2 ssl_cipher_list = EECDH+AESGCM:EDH+AESGCM ssl_prefer_server_ciphers = yes
I agree that cipher settings are important, and the only other thing I am going to say is that compared to your settings mine are severly stricter (if not anally retentive) :)
The defaults in dovecot are shown commented in conf.d/10-ssl.conf. They are not best practice for security.
I find that no default setting is "best practice" and that anyone configuring any kind of service should look at all the configuration directives and consider what they should be set to - this is why we have sysadmins, because some has to do more than "apt install" or "wget foo.sh | sudo ./foo.sh --install".
Nikolai Lusan nikolai@lusan.id.au -----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEVfd4GW6z4nsBxdLo4ZaDRV2VL6QFAl+qSbUACgkQ4ZaDRV2V L6TVbA//aXFgdiutnBlNS0oZwFMWqRZAhlBzDC0VvSLhn/i2k5SdilUGnOgxZMoM iW3/5fQ9gQuqf+SKJ7gse2j/WQnEJyMa1eJNAx4iwoq1MzbofmfEeNDipTkhW/Hq CecM85OeTG7GcMFkwVVSqdc3y/cJawaSBSJ1gdKiOqVMcH/ea89RSbHnGL1S4PD0 yaJoIJP/LlgM06tc+9BziSTpk1zSmD3extozRyLzLFY1aLUIEbWf7sEZRvo3Pe6u 11STjrUYEDJbeiEkTHK8i4HhVH9dw8eoDGEqXJCzKOntdeGv7V6Kanqb9y1xmmfb OlVHb543wYJJbT6kqqTsttmLiU2qo8lj1+kIAIu6Ydq7ANZksQ7bcFF/wEBcd8KF LO8RFDWlVgLk1CKNB6qgV5sWLcgEbrhG4AmPA0HyPDnJxAE8DMN1O1a8J+MSzFF8 XBmKIlTd51H/dJs+FYeek4C6O6ayNNr1uRzOuxV2gJ4zG3Dk0j5cBi0S4qK+W3dz GFvP5WFNvEWS3ZtQPqS5Z7/IUAiK2zT4ZoltLW7xhV4gXfnwwp0bNdWV5JZ6Tc7c M0epXpU1r6Hf62utJik6ewpNjpR9E4/F7KIvnCahX57Zb88Zl0UgS9euHwtR6M9H IBtkPa042DJNsF7gt/NwNK2jRoXBK0qg00Mrn6mKdqKEPXK6nQ0= =zNl0 -----END PGP SIGNATURE-----
Good. I am going to focus on the IMAP configuration and worry about SMTP later.
The following is the relevant documentation.
This is very straightforward:
https://doc.dovecot.org/admin_manual/ssl/dovecot_configuration/
My file 10-ssl.conf is untouched.
However, this is the part that I would like to better understand:
https://doc.dovecot.org/admin_manual/ssl/certificate_creation/
Before creating my own certificate (which I have done in the past for my old server), I am curious. Is there anything wrong with the one that comes with the distribution?
ssl_cert = < /etc/pki/dovecot/certs/dovecot.pem ssl_key = < /etc/pki/dovecot/private/dovecot.pem
As I stated before, I am attempting to achieve the simplest installation possible which will be later tightened.
Thanks!
On 11/9/2020 11:52 PM, Nikolai Lusan wrote:
Greetings,
On Mon, 2020-11-09 at 23:42 -0600, Raymond Herrera wrote:
For several years I have been running the following in a Linux server.
Dovecot Version: 2.0.9
*IMAP:* Connection Security: SSL/TLS Port: 993 Authentication Method: Normal Password
*SMTP:* Connection Security: STARTTLS Port: 587 Authentication Method: Normal Password
Pretty standard setup.
I my experience pretty much any client works with this setup.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On Tue, 2020-11-10 at 00:26 -0600, Raymond Herrera wrote:
Good. I am going to focus on the IMAP configuration and worry about SMTP later.
Yeah, also the postfix list is probably more useful for the SMTP stuff, although having said that the two products integrate seemlessly.
The following is the relevant documentation. This is very straightforward: https://doc.dovecot.org/admin_manual/ssl/dovecot_configuration/
My file 10-ssl.conf is untouched.
However, this is the part that I would like to better understand:
https://doc.dovecot.org/admin_manual/ssl/certificate_creation/
Before creating my own certificate (which I have done in the past for my old server), I am curious. Is there anything wrong with the one that comes with the distribution?
The certificate which comes with either dovecot, or your distribution (in Debian it's "/etc/ssl/certs/ssl-cert-snakeoil.pem") is a self signed certificate, which most clients will force you to accept (permanently, or temporarily). Personally I am using Lets Encrypt ( https://letsencrypt.org/) wildcard certificates (since I am not just using them for email purposes), and I have scripts that restart the relevant services when the certificates get updated (LE cert are only valid for 90 days, and can be renewed at 60 days). Look into LE and the tools available for Linux, pick the one that works for you, I use acme.sh which I find easier to script around.
ssl_cert = < /etc/pki/dovecot/certs/dovecot.pem ssl_key = < /etc/pki/dovecot/private/dovecot.pem
So this is a public/private key pair. Just like for ssh, gpg, or many other cryptography related tools. The ssl_cert line is the public certificate, and the ssl_key line is the key used to create the sign the initial certificate request (the CRL is later signed by an issuer, in the case of the snakeoil certs this is seperate private key).
There are a bunch more things worth tweaking in the ssl.conf file though :)
Nikolai Lusan nikolai@lusan.id.au -----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEVfd4GW6z4nsBxdLo4ZaDRV2VL6QFAl+qSDgACgkQ4ZaDRV2V L6T50g/8C04Q4w6jwdId3+97Q+a/hRo1nqDA1Eq206c1z+Fp+Q1gE9YLMOCLkDql DxqXRFjDWgb1+TTtkr3SW1ZC2kcDAa+kKyQvBscCTPI6+FnLSiypTCP8OMZl047C fmUjGBDJyVtIuI99r3Bq4mZ4AEsEkhnktptEHicoEBQuTLFx9nDezws5ZsVjjmAX +OqjU+hdnrNMrcob9zwhdV9xY5dklYXg/g3RPivkg9ddKLE31QW4RVO1RuN0G/Qd xZlz3NEd/TO6PnouL010/HBIFUdrg/6fm9SZoVLgZqlqtoe2Af1G1RO2rtK2lWZY RPY3wgeBY9iluxXtPkSK9e4C746rRwhD/ccNmJyIhnhEEbZYCTziBSvb2Etq+4ky TMNPi0rsDu2FAQGfc6aXFDJMv3tsMSTZMUlOe05eHHc7y7J4AaeYq0n0nRwJnL40 aeyiQDgkeW6G9EYX3zBDRY98AnE11Ydpc/mNbf5VJBscysVEGHOKONl1Pomclu/f k8w9QL6SKPIhTpsGtQ3SvJvmyhnnwueUwCJWY0vpS4Gq71CAMks1RRJWNukQvPiX D1dEkkHTiXZNhmWjLvLXX0oQ/fL9sayxkG4MrwXbJCS1sAKqhVwaGdsf3Fxn2fV5 7olrMyPYhjT2Qn1dU8V7FN4cRMHknWqxwLaEo/03M6Cs4l6wvFo= =D7tQ -----END PGP SIGNATURE-----
Thanks Nikolai,
So far, I have concluded that the Dovecot distribution seems to be ready to be deployed with essentially no modification of configuration files.
I am using CentOS 7 and sendmail.
Raymond
On 11/10/2020 1:58 AM, Nikolai Lusan wrote:
On Tue, 2020-11-10 at 00:26 -0600, Raymond Herrera wrote:
Good. I am going to focus on the IMAP configuration and worry about SMTP later.
Yeah, also the postfix list is probably more useful for the SMTP stuff, although having said that the two products integrate seemlessly.
The following is the relevant documentation. This is very straightforward: https://doc.dovecot.org/admin_manual/ssl/dovecot_configuration/
My file 10-ssl.conf is untouched.
However, this is the part that I would like to better understand:
https://doc.dovecot.org/admin_manual/ssl/certificate_creation/
Before creating my own certificate (which I have done in the past for my old server), I am curious. Is there anything wrong with the one that comes with the distribution?
The certificate which comes with either dovecot, or your distribution (in Debian it's "/etc/ssl/certs/ssl-cert-snakeoil.pem") is a self signed certificate, which most clients will force you to accept (permanently, or temporarily). Personally I am using Lets Encrypt ( https://letsencrypt.org/) wildcard certificates (since I am not just using them for email purposes), and I have scripts that restart the relevant services when the certificates get updated (LE cert are only valid for 90 days, and can be renewed at 60 days). Look into LE and the tools available for Linux, pick the one that works for you, I use acme.sh which I find easier to script around.
ssl_cert = < /etc/pki/dovecot/certs/dovecot.pem ssl_key = < /etc/pki/dovecot/private/dovecot.pem
So this is a public/private key pair. Just like for ssh, gpg, or many other cryptography related tools. The ssl_cert line is the public certificate, and the ssl_key line is the key used to create the sign the initial certificate request (the CRL is later signed by an issuer, in the case of the snakeoil certs this is seperate private key).
Am 10.11.20 um 06:42 schrieb Raymond Herrera:
I am preparing a new server, with Dovecot 2.2.36 and would like to know the currently recommended protocols. Should I stick to what I have? I would prefer to start with the easiest configuration possible, which I will revise later.
This is the command that I have been using to verify the server's functionality:
RFC 8314 suggest to prefer implicit TLS over STARTTLS https://tools.ietf.org/html/rfc8314#section-3
modern clients work mostly fine with that recommendation, too.
Andreas
Good. The options provided by Thunderbird are: None, STARTTLS and SSL/TLS. So I will select the last one.
Will I have to modify anything on the Dovecot side?
So far, my only modification to the file 10-mail.conf has been this:
mail_location = maildir:~/Mail
Raymond
On 11/10/2020 8:39 AM, A. Schulze wrote:
Am 10.11.20 um 06:42 schrieb Raymond Herrera:
I am preparing a new server, with Dovecot 2.2.36 and would like to know the currently recommended protocols. Should I stick to what I have? I would prefer to start with the easiest configuration possible, which I will revise later.
This is the command that I have been using to verify the server's functionality: RFC 8314 suggest to prefer implicit TLS over STARTTLS https://tools.ietf.org/html/rfc8314#section-3
modern clients work mostly fine with that recommendation, too.
Andreas
After some experimenting with:
(a) The Thunderbird client
(b) The Linux command as client:
% openssl s_client -connect dovecot-server:imaps
I have arrived to a preliminary conclusion. The error that I am getting is this:
dovecot: imap-login: Disconnected: TLS: SSL_read() failed: SSL routines:ssl3_read_bytes:sslv3 alert bad certificate: SSL alert number 42
It seems that the server certificate from the box is fine. I am guessing that the problem is that Dovecot asks for an SSL certificate that the Thunderbird client is not prepared to produce. I don't believe Thunderbird provides such capability (??).
If that is the case, how do I configure Dovecot to not ask for a client certificate?
Thanks,
Raymond
ps: If I am correct, the error message would be more informative as follows: "ssl3_read_bytes:sslv3 alert bad _*client*_ certificate".
On 11/9/2020 11:42 PM, Raymond Herrera wrote:
The E-mail client is Thunderbird on Windows.
I am preparing a new server, with Dovecot 2.2.36 and would like to know the currently recommended protocols. Should I stick to what I have? I would prefer to start with the easiest configuration possible, which I will revise later.
This is the command that I have been using to verify the server's functionality:
TIA
On 11/10/20 7:07 AM, Raymond Herrera wrote:
I don't believe Thunderbird provides such capability (??).
It does; works fine.
fyi
https://www.helmholtz-berlin.de/zentrum/locations/it/email/sig/cert-tbird_en...
If that is the case, how do I configure Dovecot to not ask for a client certificate?
in your ssl config, you can specify/override ssl reqt's for individual protocols.
e.g.
... protocol imap { ssl_verify_client_cert = yes auth_ssl_require_client_cert = no ssl = required }
protocol submission { ssl_verify_client_cert = yes auth_ssl_require_client_cert = no ssl = required } ...
of course, change those^ params to your specific reqt's
On Tue, Nov 10, 2020 at 09:07:37AM -0600, Raymond Herrera wrote:
I have arrived to a preliminary conclusion. The error that I am getting is this:
dovecot: imap-login: Disconnected: TLS: SSL_read() failed: SSL routines:ssl3_read_bytes:sslv3 alert bad certificate: SSL alert number 42
SSLv3 is no longer considered safe. You shouldn't use it. If the mail client program can't use something newer (I only allow TLSv2 and TLSv3), I would question whether it's a good choice. Because runaway spam is the kiss of death with blacklisting and IP reputation.
Isn't sslv3 disallowed in the default config???
If it's only for reading and not sending mail, then just manually set it up as sslv3 allowed.
Hopefully this is helpful. Debug logs can be helpful \o/, or just confusing :-[ but they are long to read through.
Good luck! Chris Bennett
On Mon, 9 Nov 2020, Raymond Herrera wrote:
I am preparing a new server, with Dovecot 2.2.36 and would like to know the currently recommended protocols. Should I stick to what I have? I would prefer to start with the easiest configuration possible, which I will revise later.
This is the command that I have been using to verify the server's functionality:
% openssl s_client -connect localhost:imaps
Implicit SSL (SSL/TLS) has the slight advantage over STARTTLS as a MITM cannot strip the STARTTLS server banner during the session handshake and downgrade the client to plaintext.
However the most important security consideration are
- set SSL version to at least TLS 1.2 to avoid
known weakness in older versions.
- set cipher list to avoid weak ciphers. One of
many guides
https://github.com/ssllabs/research/wiki/SSL-and-TLS-Deployment-Best-Practices
- (client) enforce SSL connection (i.e. refuse plaintext
sessions).
Joseph Tam jtam.home@gmail.com
On 10/11/2020 13.42, Raymond Herrera wrote:
I am preparing a new server, with Dovecot 2.2.36 and would like to know the currently recommended protocols. Should I stick to what I have? I would prefer to start with the easiest configuration possible, which I will revise later.
This is a pretty useful resource, I've found. https://ssl-config.mozilla.org/
You can choose a level of strictness to suit your environment, dovecot version etc.
P.
participants (8)
-
A. Schulze
-
Chris Bennett
-
Jeremy Ardley
-
Joseph Tam
-
Nikolai Lusan
-
PGNet Dev
-
Plutocrat
-
Raymond Herrera