Skip to content

fix: set default smtp_tls_security_level to "verify" unconditionally#902

Merged
link2xt merged 1 commit intomainfrom
link2xt/zqywtqmopxwo
Mar 23, 2026
Merged

fix: set default smtp_tls_security_level to "verify" unconditionally#902
link2xt merged 1 commit intomainfrom
link2xt/zqywtqmopxwo

Conversation

@link2xt
Copy link
Copy Markdown
Contributor

@link2xt link2xt commented Mar 23, 2026

This change was accidentally added in cf96be2 Relay should not stop validating TLS certificates of other relays just because it has a self-signed or externally managed certificate. Externally managed certificate is likely to even be valid.

This change was accidentally added in cf96be2
Relay should not stop validating TLS certificates of other relays
just because it has a self-signed or externally managed certificate.
Externally managed certificate is likely to even be valid.
@link2xt link2xt temporarily deployed to staging-ipv4.testrun.org March 23, 2026 19:36 — with GitHub Actions Inactive
@link2xt link2xt temporarily deployed to staging2.testrun.org March 23, 2026 19:36 — with GitHub Actions Inactive
link2xt referenced this pull request Mar 23, 2026
feat: support self-signed TLS via underscore domain convention
Domains starting with "_" (e.g. _chat.example.org) automatically use
self-signed TLS certificates instead of ACME/Let's Encrypt. The TLS
mode is derived from the domain name — no separate config option needed.

Internally, when config.tls_cert_mode is "self" (underscore domain):
- Generate self-signed certificates via openssl
- Set Postfix smtp_tls_security_level to "encrypt" (opportunistic TLS)
- Add smtp_tls_policy_map entry for underscore domains
- Skip ACME, MTA-STS and www CNAME checks in `cmdeploy dns`
- Serve /new via GET (not redirect to dcaccount:) with rate-limiting
  (nginx limit_req, 2r/s burst=5)
- Return dclogin: URLs with ic=3 (AcceptInvalidCertificates) from /new
- Render QR codes client-side via JavaScript and qrcode-svg
- Use config.tls_cert_path/tls_key_path in Postfix, Dovecot and nginx
  templates instead of hardcoded ACME paths
Copy link
Copy Markdown
Contributor

@missytake missytake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exceptions for smtp_tls_security_level=verify, e.g. for IP-only relays, can be added with smtp_tls_policy_maps.

@link2xt
Copy link
Copy Markdown
Contributor Author

link2xt commented Mar 23, 2026

Exceptions for smtp_tls_security_level=verify, e.g. for IP-only relays, can be added with smtp_tls_policy_maps.

This is already done. I think it is just an accident that this was not reverted after adding exception for _ in SMTP client. This is changing the policy for SMTP client depending on the certificate in SMTP server and this SMTP server certificate plays no role in outgoing connections, it is not even presented to the remote server.

@link2xt link2xt merged commit e8933c4 into main Mar 23, 2026
6 checks passed
@link2xt link2xt deleted the link2xt/zqywtqmopxwo branch March 23, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants