From e4454d776aa93fa4bb562715e07845f31365cae9 Mon Sep 17 00:00:00 2001
From: Michael Wyraz
Date: Sat, 2 May 2020 20:58:07 +0200
Subject: [PATCH 01/15] Allow to enforce TLS for outbound using
OUTBOUND_TLS_LEVEL=encrypt (default is 'may')
---
core/postfix/conf/main.cf | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/core/postfix/conf/main.cf b/core/postfix/conf/main.cf
index 43ed2df0..72828ea6 100644
--- a/core/postfix/conf/main.cf
+++ b/core/postfix/conf/main.cf
@@ -52,9 +52,10 @@ tls_high_cipherlist = EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:
tls_preempt_cipherlist = yes
tls_ssl_options = NO_COMPRESSION
-# Outgoing TLS is more flexible because 1. not all receiving servers will
-# support TLS, 2. not all will have and up-to-date TLS stack.
-smtp_tls_security_level = may
+# By default, outgoing TLS is more flexible because
+# 1. not all receiving servers will support TLS,
+# 2. not all will have and up-to-date TLS stack.
+smtp_tls_security_level = {{ OUTBOUND_TLS_LEVEL|default('may') }}
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtp_tls_protocols =!SSLv2,!SSLv3
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
From 6234da37863fd9f61fa441edd06b292db11c8eed Mon Sep 17 00:00:00 2001
From: Michael Wyraz
Date: Sat, 2 May 2020 21:02:53 +0200
Subject: [PATCH 02/15] Add doc and changelog for OUTBOUND_TLS_LEVEL
---
docs/configuration.rst | 4 ++++
towncrier/1478.feature | 1 +
2 files changed, 5 insertions(+)
create mode 100644 towncrier/1478.feature
diff --git a/docs/configuration.rst b/docs/configuration.rst
index 292d4303..20df3767 100644
--- a/docs/configuration.rst
+++ b/docs/configuration.rst
@@ -69,6 +69,10 @@ The ``RELAYHOST`` is an optional address of a mail server relaying all outgoing
mail in following format: ``[HOST]:PORT``.
``RELAYUSER`` and ``RELAYPASSWORD`` can be used when authentication is needed.
+By default postfix uses "opportunistic TLS" for outbound mail. This can be changed
+by setting ``OUTBOUND_TLS_LEVEL`` to ``encrypt``. This setting is highly recommended
+if you are a relayhost that supports TLS.
+
The ``FETCHMAIL_DELAY`` is a delay (in seconds) for the fetchmail service to
go and fetch new email if available. Do not use too short delays if you do not
want to be blacklisted by external services, but not too long delays if you
diff --git a/towncrier/1478.feature b/towncrier/1478.feature
new file mode 100644
index 00000000..fcfe6ea2
--- /dev/null
+++ b/towncrier/1478.feature
@@ -0,0 +1 @@
+Allow to enforce TLS for outbound mail by setting OUTBOUND_TLS_LEVEL=encrypt for postfix.
\ No newline at end of file
From 693fb3dbc71ad2da5bfbdd74d9b76cf1ea0e5dbc Mon Sep 17 00:00:00 2001
From: ofthesun9
Date: Mon, 11 May 2020 09:53:09 +0200
Subject: [PATCH 03/15] Harmonization of the various docker-compose.yml
Harmonization (following pr1444) between: - docs/compose/docker-compose.yml
- setup/flavors/stack/docker-compose.yml -
setup/flavors/compose/docker-compose.yml Also refresh of the mkdir command
found in setup/flavors/stack/setup.html
---
docs/compose/docker-compose.yml | 11 ++++++-----
setup/flavors/stack/docker-compose.yml | 10 +++++-----
setup/flavors/stack/setup.html | 2 +-
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/docs/compose/docker-compose.yml b/docs/compose/docker-compose.yml
index 2686ee27..42be1cb0 100644
--- a/docs/compose/docker-compose.yml
+++ b/docs/compose/docker-compose.yml
@@ -31,7 +31,7 @@ services:
- "$BIND_ADDRESS6:587:587"
volumes:
- "$ROOT/certs:/certs"
- - "$ROOT/overrides/nginx:/overrides"
+ - "$ROOT/overrides/nginx:/overrides:ro"
redis:
image: redis:alpine
@@ -45,7 +45,7 @@ services:
env_file: .env
volumes:
- "$ROOT/mail:/mail"
- - "$ROOT/overrides:/overrides"
+ - "$ROOT/overrides/dovecot:/overrides:ro"
depends_on:
- front
@@ -54,7 +54,8 @@ services:
restart: always
env_file: .env
volumes:
- - "$ROOT/overrides:/overrides"
+ - "$ROOT/mailqueue:/queue"
+ - "$ROOT/overrides/postfix:/overrides:ro"
depends_on:
- front
@@ -64,8 +65,8 @@ services:
env_file: .env
volumes:
- "$ROOT/filter:/var/lib/rspamd"
- - "$ROOT/dkim:/dkim"
- - "$ROOT/overrides/rspamd:/etc/rspamd/override.d"
+ - "$ROOT/dkim:/dkim:ro"
+ - "$ROOT/overrides/rspamd:/etc/rspamd/override.d:ro"
depends_on:
- front
diff --git a/setup/flavors/stack/docker-compose.yml b/setup/flavors/stack/docker-compose.yml
index 6ae0f103..15bfc9cb 100644
--- a/setup/flavors/stack/docker-compose.yml
+++ b/setup/flavors/stack/docker-compose.yml
@@ -27,7 +27,7 @@ services:
{% endfor %}
volumes:
- "{{ root }}/certs:/certs"
- - "{{ root }}/overrides/nginx:/overrides"
+ - "{{ root }}/overrides/nginx:/overrides:ro"
deploy:
replicas: {{ front_replicas }}
@@ -49,7 +49,7 @@ services:
env_file: {{ env }}
volumes:
- "{{ root }}/mail:/mail"
- - "{{ root }}/overrides:/overrides"
+ - "{{ root }}/overrides/dovecot:/overrides:ro"
deploy:
replicas: {{ imap_replicas }}
@@ -58,7 +58,7 @@ services:
env_file: {{ env }}
volumes:
- "{{ root }}/mailqueue:/queue"
- - "{{ root }}/overrides:/overrides"
+ - "{{ root }}/overrides/postfix:/overrides:ro"
deploy:
replicas: {{ smtp_replicas }}
@@ -67,8 +67,8 @@ services:
env_file: {{ env }}
volumes:
- "{{ root }}/filter:/var/lib/rspamd"
- - "{{ root }}/dkim:/dkim"
- - "{{ root }}/overrides/rspamd:/etc/rspamd/override.d"
+ - "{{ root }}/dkim:/dkim:ro"
+ - "{{ root }}/overrides/rspamd:/etc/rspamd/override.d:ro"
deploy:
replicas: 1
diff --git a/setup/flavors/stack/setup.html b/setup/flavors/stack/setup.html
index 5ae65cf7..9c775b20 100644
--- a/setup/flavors/stack/setup.html
+++ b/setup/flavors/stack/setup.html
@@ -4,7 +4,7 @@
Docker Stack expects a project file, named docker-compose.yml
in a project directory. First create your project directory.
-mkdir -p /{{ root }}/{redis,certs,data,dkim,mail,overrides/rspamd,overrides/nginx,filter,dav,webmail}
+mkdir -p {{ root }}/{redis,certs,data,dkim,mail,mailqueue,overrides/rspamd,overrides/postfix,overrides/dovecot,overrides/nginx,filter,dav,webmail}
Then download the project file. A side configuration file makes it easier
From b1f012d53b586820b3a2f17aff34b1074d305504 Mon Sep 17 00:00:00 2001
From: ofthesun9
Date: Tue, 12 May 2020 09:51:30 +0200
Subject: [PATCH 04/15] In setup/flavor, change DMARC rua and ruf email default
settings DMARC_RUA and DMARC_RUF defaults will reuse the value defined for
POSTMASTER, instead of 'admin' as previously
---
setup/flavors/compose/mailu.env | 4 ++--
towncrier/newsfragments/1463.bugfix | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
create mode 100644 towncrier/newsfragments/1463.bugfix
diff --git a/setup/flavors/compose/mailu.env b/setup/flavors/compose/mailu.env
index 78ecce72..b3cef48d 100644
--- a/setup/flavors/compose/mailu.env
+++ b/setup/flavors/compose/mailu.env
@@ -76,8 +76,8 @@ FETCHMAIL_DELAY={{ fetchmail_delay or '600' }}
RECIPIENT_DELIMITER={{ recipient_delimiter or '+' }}
# DMARC rua and ruf email
-DMARC_RUA={{ dmarc_rua or 'admin' }}
-DMARC_RUF={{ dmarc_ruf or 'admin' }}
+DMARC_RUA={{ dmarc_rua or postmaster }}
+DMARC_RUF={{ dmarc_ruf or postmaster }}
# Welcome email, enable and set a topic and body if you wish to send welcome
# emails to all users.
diff --git a/towncrier/newsfragments/1463.bugfix b/towncrier/newsfragments/1463.bugfix
new file mode 100644
index 00000000..37423bfa
--- /dev/null
+++ b/towncrier/newsfragments/1463.bugfix
@@ -0,0 +1 @@
+Defining POSTMASTER through setup tool apply also to DMARC_RUA and DMARC_RUF settings
From 6dbf7eb0e0d35fb33e97ac0f495f4241b4f9eacf Mon Sep 17 00:00:00 2001
From: liquidat
Date: Sun, 17 May 2020 01:50:42 +0200
Subject: [PATCH 05/15] Setup, compose: add note about reverse DNS
---
setup/templates/steps/compose/03_expose.html | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/setup/templates/steps/compose/03_expose.html b/setup/templates/steps/compose/03_expose.html
index bde4e84b..93c2147f 100644
--- a/setup/templates/steps/compose/03_expose.html
+++ b/setup/templates/steps/compose/03_expose.html
@@ -52,7 +52,9 @@ avoid generic all-interfaces addresses like 0.0.0.0
or ::MX
record. Hostnames must be comma-separated. If you're having
trouble accessing your admin interface, make sure it is the first entry here (and possibly the
-same as your DOMAIN
entry from earlier.
+same as your DOMAIN
entry from earlier). Also make sure that the first entry in
+this list resolves to the IP address of your server, and that the reverse DNS entry for
+the IP address of your server resolves to this first entry in this list.