Compare commits

...
Author SHA1 Message Date
Ruben Hensen c0cf02ce86 mail: reachable MTA-STS policy, and sign bounces and reports
The certificate did not cover mta-sts.rubenhensen.nl, so senders could
not fetch the MTA-STS policy. Add the name, and a port 80 host for its
ACME challenge.

Stalwart signs bounces and DMARC/TLS reports with the DKIM signers named
rsa-<domain> and ed25519-<domain>. Ours were called rsa and ed25519, so
those messages went out unsigned. Rename them.

A new name on the certificate means a new key, so the TLSA record comes
out here and goes back with the new hash after the deploy.
2026-11-18 11:00:07 +01:00
Ruben Hensen 634cd883e5 Merge pull request #81 from rubenhensen/dane-tlsa
dns: publish a TLSA record for the mail certificate key
2026-11-18 10:47:19 +01:00
2 changed files with 16 additions and 13 deletions

No files matched your search

-10
View File
@@ -146,13 +146,3 @@ records:
expire: 300 expire: 300
type: TXT type: TXT
content: "v=TLSRPTv1; rua=mailto:postmaster@rubenhensen.nl" content: "v=TLSRPTv1; rua=mailto:postmaster@rubenhensen.nl"
# DANE for inbound mail: SHA-256 of the public key in the certificate
# for mail.rubenhensen.nl. Renewals keep that key (--reuse-key in
# nix-infra-machine/nodes/node001.nix). To check it against the server:
# openssl s_client -connect mail.rubenhensen.nl:25 -starttls smtp </dev/null \
# | openssl x509 -noout -pubkey | openssl pkey -pubin -outform DER \
# | openssl dgst -sha256
- name: "_25._tcp.mail"
expire: 300
type: TLSA
content: "3 1 1 718809043219a89d490b97503dd176c2557fd67a15679acdfaa0ced7143ee6b8"
+16 -3
View File
@@ -152,6 +152,7 @@ in
extraDomainNames = [ extraDomainNames = [
"autoconfig.rubenhensen.nl" "autoconfig.rubenhensen.nl"
"autodiscover.rubenhensen.nl" "autodiscover.rubenhensen.nl"
"mta-sts.rubenhensen.nl"
"rubenhensen.nl" "rubenhensen.nl"
]; ];
# Keep the same key on renewal. The TLSA record in # Keep the same key on renewal. The TLSA record in
@@ -242,6 +243,16 @@ ${sniMapEntries}
locations."/.well-known/acme-challenge/".root = "/var/lib/acme/acme-challenge"; locations."/.well-known/acme-challenge/".root = "/var/lib/acme/acme-challenge";
locations."/".return = "301 https://$host$request_uri"; locations."/".return = "301 https://$host$request_uri";
}; };
# Senders fetch the MTA-STS policy from here over HTTPS. Stalwart
# serves it, so the certificate has to carry this name too.
"mta-sts.rubenhensen.nl" = {
listen = [
{ addr = "0.0.0.0"; port = 80; }
{ addr = "[::]"; port = 80; }
];
locations."/.well-known/acme-challenge/".root = "/var/lib/acme/acme-challenge";
locations."/".return = "301 https://$host$request_uri";
};
"rubenhensen.nl" = { "rubenhensen.nl" = {
listen = [ listen = [
{ addr = "0.0.0.0"; port = 80; } { addr = "0.0.0.0"; port = 80; }
@@ -446,7 +457,9 @@ ${sniMapEntries}
client-secret = "%{file:/run/credentials/stalwart-mail.service/oidc-client-secret}%"; client-secret = "%{file:/run/credentials/stalwart-mail.service/oidc-client-secret}%";
}; };
signature."rsa" = { # Stalwart signs bounces and DMARC/TLS reports with the signers
# named rsa-<domain> and ed25519-<domain>, so keep these names.
signature."rsa-rubenhensen.nl" = {
private-key = "%{file:/run/credentials/stalwart-mail.service/dkim-rsa.key}%"; private-key = "%{file:/run/credentials/stalwart-mail.service/dkim-rsa.key}%";
domain = "rubenhensen.nl"; domain = "rubenhensen.nl";
selector = "202603r2"; selector = "202603r2";
@@ -458,7 +471,7 @@ ${sniMapEntries}
report = true; report = true;
}; };
signature."ed25519" = { signature."ed25519-rubenhensen.nl" = {
private-key = "%{file:/run/credentials/stalwart-mail.service/dkim-ed25519.key}%"; private-key = "%{file:/run/credentials/stalwart-mail.service/dkim-ed25519.key}%";
domain = "rubenhensen.nl"; domain = "rubenhensen.nl";
selector = "202603e2"; selector = "202603e2";
@@ -470,7 +483,7 @@ ${sniMapEntries}
}; };
auth.dkim.sign = [ auth.dkim.sign = [
{ "if" = "listener != 'smtp'"; "then" = "['rsa', 'ed25519']"; } { "if" = "listener != 'smtp'"; "then" = "['rsa-rubenhensen.nl', 'ed25519-rubenhensen.nl']"; }
{ "else" = false; } { "else" = false; }
]; ];