Merge remote-tracking branch 'upstream/main'

This commit is contained in:
adbenitez
2025-02-16 23:32:10 +01:00
6 changed files with 28 additions and 49 deletions
+6
View File
@@ -11,6 +11,12 @@
- improve secure-join message detection
([#473](https://github.com/deltachat/chatmail/pull/473))
- use old crypt lib in python < 3.11
([#483](https://github.com/deltachat/chatmail/pull/483))
- remove MTA-STS daemon
([#488](https://github.com/deltachat/chatmail/pull/488))
## 1.5.0 2024-12-20
- cmdeploy dns: always show recommended DNS records
+1 -1
View File
@@ -12,7 +12,7 @@ dependencies = [
"deltachat-rpc-client",
"filelock",
"requests",
"crypt-r",
"crypt-r >= 3.13.1 ; python_version >= '3.11'",
]
[tool.setuptools]
+4 -1
View File
@@ -3,7 +3,10 @@ import logging
import os
import sys
import crypt_r
try:
import crypt_r
except ImportError:
import crypt as crypt_r
from .config import Config, read_config
from .dictproxy import DictProxy
+14 -44
View File
@@ -224,42 +224,21 @@ def _configure_opendkim(domain: str, dkim_selector: str = "dkim") -> bool:
return need_restart
def _install_mta_sts_daemon() -> bool:
need_restart = False
def _uninstall_mta_sts_daemon() -> None:
# Remove configuration.
files.file("/etc/mta-sts-daemon.yml", present=False)
config = files.put(
name="upload postfix-mta-sts-resolver config",
src=importlib.resources.files(__package__).joinpath(
"postfix/mta-sts-daemon.yml"
),
dest="/etc/mta-sts-daemon.yml",
user="root",
group="root",
mode="644",
files.directory("/usr/local/lib/postfix-mta-sts-resolver", present=False)
files.file("/etc/systemd/system/mta-sts-daemon.service", present=False)
systemd.service(
name="Stop MTA-STS daemon",
service="mta-sts-daemon.service",
daemon_reload=True,
running=False,
enabled=False,
)
need_restart |= config.changed
server.shell(
name="install postfix-mta-sts-resolver with pip",
commands=[
"python3 -m virtualenv /usr/local/lib/postfix-mta-sts-resolver",
"/usr/local/lib/postfix-mta-sts-resolver/bin/pip install postfix-mta-sts-resolver",
],
)
systemd_unit = files.put(
name="upload mta-sts-daemon systemd unit",
src=importlib.resources.files(__package__).joinpath(
"postfix/mta-sts-daemon.service"
),
dest="/etc/systemd/system/mta-sts-daemon.service",
user="root",
group="root",
mode="644",
)
need_restart |= systemd_unit.changed
return need_restart
def _configure_postfix(config: Config, debug: bool = False) -> bool:
@@ -675,8 +654,8 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None:
debug = False
dovecot_need_restart = _configure_dovecot(config, debug=debug)
postfix_need_restart = _configure_postfix(config, debug=debug)
mta_sts_need_restart = _install_mta_sts_daemon()
nginx_need_restart = _configure_nginx(config)
_uninstall_mta_sts_daemon()
_remove_rspamd()
opendkim_need_restart = _configure_opendkim(mail_domain, "opendkim")
@@ -689,15 +668,6 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None:
restarted=opendkim_need_restart,
)
systemd.service(
name="Start and enable MTA-STS daemon",
service="mta-sts-daemon.service",
daemon_reload=True,
running=True,
enabled=True,
restarted=mta_sts_need_restart,
)
# Dovecot should be started before Postfix
# because it creates authentication socket
# required by Postfix.
+1 -1
View File
@@ -16,7 +16,7 @@ www.{{ mail_domain }}. CNAME {{ mail_domain }}.
;
; Recommended DNS entries for interoperability and security-hardening
;
{{ mail_domain }}. TXT "v=spf1 a:{{ mail_domain }} ~all"
{{ mail_domain }}. TXT "v=spf1 a ~all"
_dmarc.{{ mail_domain }}. TXT "v=DMARC1;p=reject;adkim=s;aspf=s"
{% if acme_account_url %}
+2 -2
View File
@@ -20,9 +20,9 @@ smtpd_tls_key_file=/var/lib/acme/live/{{ config.mail_domain }}/privkey
smtpd_tls_security_level=may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_security_level=verify
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_policy_maps = socketmap:inet:127.0.0.1:8461:postfix
smtp_tls_policy_maps = inline:{nauta.cu=may}
smtpd_tls_protocols = >=TLSv1.2
# Disable anonymous cipher suites