Document that SMTP supports port 465 only !5

merged merged by cmc on 2026-10-24 03:32 UTC · krz/domain-dig:smtp-465-only into main

3 files changed, +33 −0

Layout: unified · split

Docs/integrations.txt added +28
@@ -0,0 +1,28 @@
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 prefers implicit TLS over STARTTLS for mail submission. It also
27 asks that both be offered during the transition, so supporting 465 alone is
28 narrower than the RFC wants; the transport constraints above are the reason.
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