Docs/integrations.txt

2ad5d8160338d289a65d6a4d1c214a02bf916f1f
domain-dig/Docs/integrations.txt history · blame · raw

28 lines · 1381 bytes

 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.