Composable Network Protocols vs. Encapsulation
250bpm.com
250bpm.com
Originally, SMTP on port 25 did not support TLS. Later on, SMTPS came along, which uses/used port 465, and which immediately started TLS on connection open, with the standard SMTP traffic happening once TLS setup was complete. So, by choosing a different port (465 vs. 25), you (the client) were able to say "I want to do SMTP over TLS, and you [the server, operating port 465] want to do the same, so let's just do it immediately!". Nowadays, you have ESMTP on port 25, where the server advertises support for STARTTLS, the client requests startup of TLS on the session, and once the TLS connection is up, then you have your proper SMTP conversation.
See also, RFC 8314.
It's work in progress, but should be easy to reason about and work with even without using coroutines.