10-ssl.conf.j2 2.82 KB
Newer Older
Hinrikus Wolf's avatar
Hinrikus Wolf committed
1 2 3 4 5 6 7 8 9 10 11
##
## SSL settings
##

# SSL/TLS support: yes, no, required. <doc/wiki/SSL.txt>
ssl = required

# PEM encoded X.509 SSL/TLS certificate and private key. They're opened before
# dropping root privileges, so keep the key file unreadable by anyone but
# root. Included doc/mkcert.sh can be used to easily generate self-signed
# certificate, just make sure to update the domains in dovecot-openssl.cnf
Lars Beckers's avatar
Lars Beckers committed
12 13
ssl_cert = <{{ dovecot_tls_cert }}
ssl_key = <{{ dovecot_tls_key }}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

# If key file is password protected, give the password here. Alternatively
# give it when starting dovecot with -p parameter. Since this file is often
# world-readable, you may want to place this setting instead to a different
# root owned 0600 file by using ssl_key_password = <path.
#ssl_key_password =

# PEM encoded trusted certificate authority. Set this only if you intend to use
# ssl_verify_client_cert=yes. The file should contain the CA certificate(s)
# followed by the matching CRL(s). (e.g. ssl_ca = </etc/ssl/certs/ca.pem)
#ssl_ca = 

# Require that CRL check succeeds for client certificates.
#ssl_require_crl = yes

# Directory and/or file for trusted SSL CA certificates. These are used only
# when Dovecot needs to act as an SSL client (e.g. imapc backend). The
# directory is usually /etc/ssl/certs in Debian-based systems and the file is
# /etc/pki/tls/cert.pem in RedHat-based systems.
Lars Beckers's avatar
Lars Beckers committed
33
ssl_client_ca_dir = {{ dovecot_tls_ca_dir }}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
34 35 36 37 38 39 40 41 42 43 44
#ssl_client_ca_file =

# Request client to send a certificate. If you also want to require it, set
# auth_ssl_require_client_cert=yes in auth section.
#ssl_verify_client_cert = no

# Which field from certificate to use for username. commonName and
# x500UniqueIdentifier are the usual choices. You'll also need to set
# auth_ssl_username_from_cert=yes.
#ssl_cert_username_field = commonName

45
{% if ansible_distribution_major_version|int < 10 %}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
46
# DH parameters length to use.
47
{% if dovecot_tls_dh_length %}
Lars Beckers's avatar
Lars Beckers committed
48
ssl_dh_parameters_length = {{ dovecot_tls_dh_length }}
49 50 51 52 53 54 55 56 57 58 59
{% else %}
#ssl_dh_parameters_length =
{% endif %}
{% else %}
# DH parameters to use.
{% if dovecot_tls_dh_file %}
ssl_dh = </etc/dovecot/dh.pem
{% else %}
#ssl_dh =
{% endif %}
{% endif %}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
60

61
{% if ansible_distribution_major_version|int < 10 %}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
62
# SSL protocols to use
Lars Beckers's avatar
Lars Beckers committed
63
ssl_protocols = {{ dovecot_tls_protocols }}
64 65 66 67
{% else %}
# Minimum TLS version to use
ssl_min_protocol = {{ dovecot_tls_min_protocol }}
{% endif %}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
68 69

# SSL ciphers to use
70
{% if dovecot_tls_ciphers %}
Lars Beckers's avatar
Lars Beckers committed
71
ssl_cipher_list = {{ dovecot_tls_ciphers }}
72 73 74
{% else %}
#ssl_cipher_list =
{% endif %}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
75 76

# Prefer the server's order of ciphers over client's.
77
ssl_prefer_server_ciphers = {{ 'yes' if dovecot_tls_prefer_server_ciphers else 'no' }}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
78 79 80 81 82 83

# SSL crypto device to use, for valid values run "openssl engine"
#ssl_crypto_device =

# SSL extra options. Currently supported options are:
#   no_compression - Disable compression.
84
ssl_options = no_compression