Compare commits

..

39 Commits

Author SHA1 Message Date
missytake c541447f9b CI: wait with VRFY test until echobot is logged in 2024-05-02 16:21:08 +02:00
missytake aed3803d17 wait a minute with tests to avoid VRFY creating echo@ 2024-05-02 15:27:57 +02:00
missytake 9787a43902 echo: re-enable test 2024-05-02 13:49:09 +02:00
missytake e525d36899 changelog for #276 2024-05-02 13:48:38 +02:00
missytake 6bbb5e07e5 echo: skip test as long as it's broken 2024-05-02 13:33:11 +02:00
missytake f35d98bb40 acmetool: enable debugging 2024-05-01 10:45:21 +02:00
missytake 7ce1a5e841 ci: don't fail if /var/lib/acme isn't present 2024-05-01 00:41:11 +02:00
missytake 0a72c2fba7 acmetool: accept new terms of services
closes #275
2024-05-01 00:21:58 +02:00
link2xt 824f70f463 Document email authentication requirements 2024-04-19 21:12:54 +02:00
link2xt 39f5f64998 Reload Dovecot and Postfix when TLS certificate updates (#271) 2024-04-15 14:08:32 +00:00
Christian Hagenest 1752803199 changelog for #270 2024-04-11 19:41:43 +02:00
Christian Hagenest e372599ce7 change location of changes per nami's recommendation 2024-04-11 19:15:28 +02:00
Christian Hagenest ce9fb02a75 correct key for obs home deltachat 2024-04-11 19:15:28 +02:00
Christian Hagenest 4526f5e772 apt update after adding new repository 2024-04-11 19:15:28 +02:00
Christian Hagenest 616a42c8f3 add our obs repo to cmdeploy init 2024-04-11 19:15:28 +02:00
holger krekel ecb5ef8a10 start new untagged section post 1.2.0 2024-04-04 18:30:11 +02:00
holger krekel 824c3dc1d7 prepare tagging 1.2.0 2024-04-04 18:28:35 +02:00
holger krekel 9b76d46558 refinements and fixes 2024-04-04 12:57:49 +02:00
holger krekel cc4920ddc7 a bit of renaming 2024-04-04 12:57:49 +02:00
holger krekel 2af10175fa ignore and remove .tmp files in notification_dir 2024-04-04 12:57:49 +02:00
holger krekel ae455fa9e1 avoid float with time, and be safe against crashes during file writing 2024-04-04 12:57:49 +02:00
holger krekel 60d7e516dd 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-04 12:57:49 +02:00
holger krekel bf18905e02 address typo-level review comments 2024-04-04 12:57:49 +02:00
holger krekel 4d6f520f18 finally use persistent queue items with random file names, simplifying the flows 2024-04-04 12:57:49 +02:00
holger krekel 9da626dfc8 proper doc string for Notifier 2024-04-04 12:57:49 +02:00
holger krekel 1cca9aa441 fix failing CI (uncovering real bug) 2024-04-04 12:57:49 +02:00
holger krekel 3d054847a0 split metadata and notifier into separate files 2024-04-04 12:57:49 +02:00
holger krekel a31d998e67 separate notification thread into own class, and test start_notification_threads 2024-04-04 12:57:49 +02:00
holger krekel d313bea97f some more renaming 2024-04-04 12:57:49 +02:00
holger krekel da04226594 fix 2024-04-04 12:57:49 +02:00
holger krekel eb2de26638 fix changelog 2024-04-04 12:57:49 +02:00
holger krekel f5652cdbc4 better naming 2024-04-04 12:57:49 +02:00
holger krekel 13172c92f3 some refinements and extending the tests 2024-04-04 12:57:49 +02:00
holger krekel 09df636183 extend testing 2024-04-04 12:57:49 +02:00
holger krekel 2b45ace3ba refine testing and code 2024-04-04 12:57:49 +02:00
holger krekel 9e05a7d1eb more precision 2024-04-04 12:57:49 +02:00
holger krekel 21e7c09c43 remove redundant test code for requests mocking 2024-04-04 12:57:49 +02:00
holger krekel 14d96e0a9b snap somewhat working again 2024-04-04 12:57:49 +02:00
holger krekel 459ffcabd6 better preserve notification order, using a queue again 2024-04-04 12:57:49 +02:00
9 changed files with 74 additions and 17 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ jobs:
# restore acme & dkim state to staging.testrun.org # restore acme & dkim state to staging.testrun.org
rsync -avz acme-restore/acme/ root@staging.testrun.org:/var/lib/acme || true 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 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 ssh -o StrictHostKeyChecking=accept-new -v root@staging.testrun.org chown root:root -R /var/lib/acme || true
- name: run formatting checks - name: run formatting checks
run: cmdeploy fmt -v run: cmdeploy fmt -v
+12 -1
View File
@@ -1,6 +1,17 @@
# Changelog for chatmail deployment # Changelog for chatmail deployment
## untagged ## 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
- Install dig on the server to resolve DNS records - Install dig on the server to resolve DNS records
([#267](https://github.com/deltachat/chatmail/pull/267)) ([#267](https://github.com/deltachat/chatmail/pull/267))
+23
View File
@@ -159,4 +159,27 @@ While this file is present, account creation will be blocked.
Delta Chat apps will, however, discover all ports and configurations 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. 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.
+17 -1
View File
@@ -483,6 +483,23 @@ def deploy_chatmail(config_path: Path) -> None:
commands=["test -d /home/vmail && chown -R vmail:vmail /home/vmail"], 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.update(name="apt update", cache_time=24 * 3600)
apt.packages( apt.packages(
@@ -513,7 +530,6 @@ def deploy_chatmail(config_path: Path) -> None:
# Deploy acmetool to have TLS certificates. # Deploy acmetool to have TLS certificates.
deploy_acmetool( deploy_acmetool(
nginx_hook=True,
domains=[mail_domain, f"mta-sts.{mail_domain}", f"www.{mail_domain}"], domains=[mail_domain, f"mta-sts.{mail_domain}", f"www.{mail_domain}"],
) )
+9 -12
View File
@@ -5,7 +5,7 @@ from pyinfra import host
from pyinfra.facts.systemd import SystemdStatus from pyinfra.facts.systemd import SystemdStatus
def deploy_acmetool(nginx_hook=False, email="", domains=[]): def deploy_acmetool(email="", domains=[]):
"""Deploy acmetool.""" """Deploy acmetool."""
apt.packages( apt.packages(
name="Install acmetool", name="Install acmetool",
@@ -20,16 +20,13 @@ def deploy_acmetool(nginx_hook=False, email="", domains=[]):
mode="644", mode="644",
) )
if nginx_hook: files.put(
files.put( src=importlib.resources.files(__package__).joinpath("acmetool.hook").open("rb"),
src=importlib.resources.files(__package__) dest="/usr/lib/acme/hooks/nginx",
.joinpath("acmetool.hook") user="root",
.open("rb"), group="root",
dest="/usr/lib/acme/hooks/nginx", mode="744",
user="root", )
group="root",
mode="744",
)
files.template( files.template(
src=importlib.resources.files(__package__).joinpath("response-file.yaml.j2"), src=importlib.resources.files(__package__).joinpath("response-file.yaml.j2"),
@@ -74,5 +71,5 @@ def deploy_acmetool(nginx_hook=False, email="", domains=[]):
server.shell( server.shell(
name=f"Request certificate for: { ', '.join(domains) }", name=f"Request certificate for: { ', '.join(domains) }",
commands=[f"acmetool want { ' '.join(domains)}"], commands=[f"acmetool want --xlog.severity=debug { ' '.join(domains)}"],
) )
@@ -3,3 +3,5 @@ set -e
EVENT_NAME="$1" EVENT_NAME="$1"
[ "$EVENT_NAME" = "live-updated" ] || exit 42 [ "$EVENT_NAME" = "live-updated" ] || exit 42
systemctl restart nginx.service systemctl restart nginx.service
systemctl reload dovecot.service
systemctl reload postfix.service
@@ -1,2 +1,2 @@
"acme-enter-email": "{{ email }}" "acme-enter-email": "{{ email }}"
"acme-agreement:https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf": true "acme-agreement:https://letsencrypt.org/documents/LE-SA-v1.4-April-3-2024.pdf": true
Binary file not shown.
@@ -2,6 +2,7 @@ import pytest
import threading import threading
import queue import queue
import socket import socket
import time
from chatmaild.config import read_config from chatmaild.config import read_config
from cmdeploy.cmdeploy import main from cmdeploy.cmdeploy import main
@@ -81,7 +82,14 @@ def test_concurrent_logins_same_account(
assert login_results.get() assert login_results.get()
def test_no_vrfy(chatmail_config): 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
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((chatmail_config.mail_domain, 25)) sock.connect((chatmail_config.mail_domain, 25))
banner = sock.recv(1024) banner = sock.recv(1024)