Compare commits

..

22 Commits

Author SHA1 Message Date
holger krekel
31f0e4a9ec refinements and fixes 2024-04-03 18:50:20 +02:00
holger krekel
a2be4dcc38 a bit of renaming 2024-04-03 18:31:32 +02:00
holger krekel
78ac2f5ce2 ignore and remove .tmp files in notification_dir 2024-04-03 18:31:32 +02:00
holger krekel
aee68b05b5 avoid float with time, and be safe against crashes during file writing 2024-04-03 18:31:32 +02:00
holger krekel
a3b6223039 implemented suggestion fopr using an absolute deadline instead of retrying but choose 5 hours for now because if our own notification server is down/buggy we have at least a bit of time to fix it 2024-04-03 18:31:32 +02:00
holger krekel
f01360855d address typo-level review comments 2024-04-03 18:31:32 +02:00
holger krekel
5c67effe55 finally use persistent queue items with random file names, simplifying the flows 2024-04-03 18:31:32 +02:00
holger krekel
91effb0998 proper doc string for Notifier 2024-04-03 18:31:32 +02:00
holger krekel
5b00ff193f fix failing CI (uncovering real bug) 2024-04-03 18:31:32 +02:00
holger krekel
0272fcb5f4 split metadata and notifier into separate files 2024-04-03 18:31:32 +02:00
holger krekel
50a3930c74 separate notification thread into own class, and test start_notification_threads 2024-04-03 18:31:32 +02:00
holger krekel
24f7d89bee some more renaming 2024-04-03 18:31:32 +02:00
holger krekel
6caa8ba868 fix 2024-04-03 18:31:32 +02:00
holger krekel
4f8fab9428 fix changelog 2024-04-03 18:31:31 +02:00
holger krekel
f12f659a80 better naming 2024-04-03 18:31:17 +02:00
holger krekel
07003cb69e some refinements and extending the tests 2024-04-03 18:31:17 +02:00
holger krekel
59e529aa0f extend testing 2024-04-03 18:31:17 +02:00
holger krekel
49d8d248b4 refine testing and code 2024-04-03 18:31:17 +02:00
holger krekel
8b14e7fde0 more precision 2024-04-03 18:31:17 +02:00
holger krekel
da39a2aa58 remove redundant test code for requests mocking 2024-04-03 18:31:17 +02:00
holger krekel
f8e41b04b6 snap somewhat working again 2024-04-03 18:31:17 +02:00
holger krekel
a038452ee5 better preserve notification order, using a queue again 2024-04-03 18:31:17 +02:00
9 changed files with 17 additions and 74 deletions

View File

@@ -56,7 +56,7 @@ jobs:
# restore acme & dkim state to staging.testrun.org
rsync -avz acme-restore/acme/ root@staging.testrun.org:/var/lib/acme || true
rsync -avz dkimkeys-restore/dkimkeys/ root@staging.testrun.org:/etc/dkimkeys || true
ssh -o StrictHostKeyChecking=accept-new -v root@staging.testrun.org chown root:root -R /var/lib/acme || true
ssh -o StrictHostKeyChecking=accept-new -v root@staging.testrun.org chown root:root -R /var/lib/acme
- name: run formatting checks
run: cmdeploy fmt -v

View File

@@ -1,17 +1,6 @@
# Changelog for chatmail deployment
## untagged
- Accept Let's Encrypt's new Terms of Services
([#275](https://github.com/deltachat/chatmail/pull/276))
- Reload Dovecot and Postfix when TLS certificate updates
([#271](https://github.com/deltachat/chatmail/pull/271))
- Use forked version of dovecot without hardcoded delays
([#270](https://github.com/deltachat/chatmail/pull/270))
## 1.2.0 - 2024-04-04
## untagged
- Install dig on the server to resolve DNS records
([#267](https://github.com/deltachat/chatmail/pull/267))

View File

@@ -159,27 +159,4 @@ While this file is present, account creation will be blocked.
Delta Chat apps will, however, discover all ports and configurations
automatically by reading the [autoconfig XML file](https://www.ietf.org/archive/id/draft-bucksch-autoconfig-00.html) from the chatmail service.
## Email authentication
chatmail servers rely on [DKIM](https://www.rfc-editor.org/rfc/rfc6376)
to authenticate incoming emails.
Incoming emails must have a valid DKIM signature with
Signing Domain Identifier (SDID, `d=` parameter in the DKIM-Signature header)
equal to the `From:` header domain.
This property is checked by OpenDKIM screen policy script
before validating the signatures.
This correpsonds to strict [DMARC](https://www.rfc-editor.org/rfc/rfc7489) alignment (`adkim=s`),
but chatmail does not rely on DMARC and does not consult the sender policy published in DMARC records.
Other legacy authentication mechanisms such as [iprev](https://www.rfc-editor.org/rfc/rfc8601#section-2.7.3)
and [SPF](https://www.rfc-editor.org/rfc/rfc7208) are also not taken into account.
If there is no valid DKIM signature on the incoming email,
the sender receives a "5.7.1 No valid DKIM signature found" error.
Outgoing emails must be sent over authenticated connection
with envelope MAIL FROM (return path) corresponding to the login.
This is ensured by Postfix which maps login username
to MAIL FROM with
[`smtpd_sender_login_maps`](https://www.postfix.org/postconf.5.html#smtpd_sender_login_maps)
and rejects incorrectly authenticated emails with [`reject_sender_login_mismatch`](reject_sender_login_mismatch) policy.
`From:` header must correspond to envelope MAIL FROM,
this is ensured by `filtermail` proxy.

View File

@@ -483,23 +483,6 @@ def deploy_chatmail(config_path: Path) -> None:
commands=["test -d /home/vmail && chown -R vmail:vmail /home/vmail"],
)
# Add our OBS repository for dovecot_no_delay
files.put(
name = "Add Deltachat OBS GPG key to apt keyring",
src = importlib.resources.files(__package__).joinpath("obs-home-deltachat.gpg"),
dest = "/etc/apt/keyrings/obs-home-deltachat.gpg",
user="root",
group="root",
mode="644",
)
files.line(
name = "Add DeltaChat OBS home repository to sources.list",
path = "/etc/apt/sources.list",
line = "deb [signed-by=/etc/apt/keyrings/obs-home-deltachat.gpg] https://download.opensuse.org/repositories/home:/deltachat/Debian_12/ ./",
ensure_newline = True,
)
apt.update(name="apt update", cache_time=24 * 3600)
apt.packages(
@@ -530,6 +513,7 @@ def deploy_chatmail(config_path: Path) -> None:
# Deploy acmetool to have TLS certificates.
deploy_acmetool(
nginx_hook=True,
domains=[mail_domain, f"mta-sts.{mail_domain}", f"www.{mail_domain}"],
)

View File

@@ -5,7 +5,7 @@ from pyinfra import host
from pyinfra.facts.systemd import SystemdStatus
def deploy_acmetool(email="", domains=[]):
def deploy_acmetool(nginx_hook=False, email="", domains=[]):
"""Deploy acmetool."""
apt.packages(
name="Install acmetool",
@@ -20,13 +20,16 @@ def deploy_acmetool(email="", domains=[]):
mode="644",
)
files.put(
src=importlib.resources.files(__package__).joinpath("acmetool.hook").open("rb"),
dest="/usr/lib/acme/hooks/nginx",
user="root",
group="root",
mode="744",
)
if nginx_hook:
files.put(
src=importlib.resources.files(__package__)
.joinpath("acmetool.hook")
.open("rb"),
dest="/usr/lib/acme/hooks/nginx",
user="root",
group="root",
mode="744",
)
files.template(
src=importlib.resources.files(__package__).joinpath("response-file.yaml.j2"),
@@ -71,5 +74,5 @@ def deploy_acmetool(email="", domains=[]):
server.shell(
name=f"Request certificate for: { ', '.join(domains) }",
commands=[f"acmetool want --xlog.severity=debug { ' '.join(domains)}"],
commands=[f"acmetool want { ' '.join(domains)}"],
)

View File

@@ -3,5 +3,3 @@ set -e
EVENT_NAME="$1"
[ "$EVENT_NAME" = "live-updated" ] || exit 42
systemctl restart nginx.service
systemctl reload dovecot.service
systemctl reload postfix.service

View File

@@ -1,2 +1,2 @@
"acme-enter-email": "{{ email }}"
"acme-agreement:https://letsencrypt.org/documents/LE-SA-v1.4-April-3-2024.pdf": true
"acme-agreement:https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf": true

View File

@@ -2,7 +2,6 @@ import pytest
import threading
import queue
import socket
import time
from chatmaild.config import read_config
from cmdeploy.cmdeploy import main
@@ -82,14 +81,7 @@ def test_concurrent_logins_same_account(
assert login_results.get()
def test_no_vrfy(chatmail_config, remote):
found = False
while not found:
for line in remote.iter_output(logcmd="journalctl -u echobot"):
print(line)
if "successfully logged into imap server" in line:
found = True
break
def test_no_vrfy(chatmail_config):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((chatmail_config.mail_domain, 25))
banner = sock.recv(1024)