Commit 24736d6462

24736d6462fc6ecb4d26a87d294b0a8201c037d6

parent: 9cfb50f90b

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-24 03:24 UTC

Document that SMTP supports port 465 only

Add a caption under the SMTP port field stating that port 465 with Direct
TLS is supported and port 587 (STARTTLS) is not. Add Docs/integrations.txt
recording why STARTTLS is not implemented and link it from README.org.

Layout: unified · split

Docs/integrations.txt added +27
@@ -0,0 +1,27 @@
1# DomainDig Integrations
2
3## SMTP submission
4
5Email integrations support implicit TLS ("Direct TLS") on port 465. STARTTLS
6on port 587 is not supported.
7
8`SMTPSecurityMode` has two cases: `.plain` and `.directTLS`. Sending with a
9username configured and `.plain` selected throws
10`IntegrationError.insecureCredentials`, and the integration editor refuses to
11save that combination.
12
13Why STARTTLS is not implemented:
14
15- `NWConnection` cannot add TLS to an established connection. The protocol
16 stack is fixed when `NWParameters` is constructed, so the plaintext SMTP
17 greeting and the `STARTTLS` exchange cannot be followed by a TLS handshake
18 on the same connection.
19- The alternative is CFStream, which can negotiate TLS in place through
20 `kCFStreamPropertySSLSettings`. `CFStreamCreatePairWithSocketToHost` is
21 deprecated in favour of Network.framework, which is the API that cannot do
22 this. CFStream also has no handshake-completion callback and needs its own
23 run-loop thread. A correct implementation must discard any bytes buffered
24 before the upgrade; otherwise it is open to the STARTTLS plaintext-injection
25 attack (CVE-2011-0411).
26- RFC 8314 section 3.3 recommends implicit TLS on port 465 over STARTTLS on
27 port 587 for mail submission.
DomainDig/IntegrationsView.swift +4
@@ -290,6 +290,10 @@ private struct IntegrationEditorView: View {
290290 TextField("Port", text: $emailPort)
291291 .keyboardType(.numberPad)
292292
293 Text("Port 465 with Direct TLS is supported. Port 587 (STARTTLS) is not.")
294 .font(.caption)
295 .foregroundStyle(Color(.appTextSecondary))
296
293297 TextField("Username", text: $emailUsername)
294298 .textInputAutocapitalization(.never)
295299 .autocorrectionDisabled()
README.org +1
@@ -68,6 +68,7 @@ git config core.hooksPath .githooks
6868#+begin_example
6969local api: Docs/local-api.txt
7070data migration: Docs/data-migration.txt
71integrations: Docs/integrations.txt
7172accessibility: Docs/ACCESSIBILITY.txt
7273security: SECURITY.txt
7374#+end_example