Email encryption - what is needed? #4235
-
This question relates to emails with personal or sensitive content and attachments. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
SSL/TLS is only used to encrypt the traffic between mail servers (or from a client to a server). Every mail server (MTA) gets the mail in plain text. It's not guaranteed, that every MTA to MTA connection is encrypted. If only the receiver should be able to read the mail content, you should look into S/MIME or GPG/PGP. |
Beta Was this translation helpful? Give feedback.
-
@casperklein answered this well! My response is just a longer version of that saying effectively the same thing 😅 When you access a website, you will connect from the web browser (client) to the server over HTTPS, your connection is secure.
Mail is not too different from that, your mail client (submitting mail to be sent, or retrieving mail from the server) can function in the same way. More often accessing your mailbox is more like the web browser scenario. Submitting mail is a connection between you and DMS, where that mail is then queued up for delivery. Unlike the other two scenarios the connection has finished between your client and DMS. Now the mail will be sent to the intended mail server for the recipient, but this is done via port 25 (STARTTLS) where encryption is not guaranteed (unlike port 465 for mail submission from your client to DMS). Technically, if your DNS was compromised your connection could go to a different server, this could happen if you connect to public wifi (a less trustworthy network) or even from your ISP as traffic can flow through different systems along the way as your connection is routed to the intended IP address. As port 25 is STARTTLS it begins unencrypted, and must negotiate between the server to upgrade to TLS. Thus the malicious party could prevent this upgrade and force the traffic to be unencrypted where they can inspect the content and potentially alter it. This was found to be done in the past by an ISP or Airport in Thailand I think? For compatibility it's expected that mail servers allow unencrypted mail delivery on this port when they receive mail. When the mail server is sending mail out on this port however, it can choose to only send mail that is successfully upgraded to TLS. You can learn about this with MTA-STS, which is a way to say "if we have had a secure connection previously, there should be no reason for an insecure connection to occur, I will only trust secure connections with this server now". This does only ensure TLS between the direct connection DMS makes however, as similar to proxies there are also mail relays. You may choose to use one yourself like SendGrid, where instead of port 25, DMS authenticates over port 465 (or 587) to SendGrid and sends the mail for SendGrid (the relay) to send to your recipient mail server. You lose control over how secure the network is from there on. Likewise, a big mail provider could have many mail servers that you connect to publicly, and these may forward the mail internally to their own private mail servers. All this to say that regardless of mail server or web server, a client only has a direct connection with the first hop/server that they are connected to.
The other difference is with the web server, even if there are multiple hops, it's generally trustworthy because the web browser to web server connection is predictable (A => B), implicit TLS from the start is all that really matters there if you trust the web service and the web service trusts any additional proxies they have actively chosen (that said a forward proxy can exist like in businesses with you as an employee on their network that sits between your client and the service, the business controls enough to terminate TLS and inspect the traffic before making the outbound connection to the real server over TLS). With mail submission you only have implicit TLS on the users side from their client to your mail server (DMS), and optionally to any relay service you may use. MTA-STS may help you ensure TLS to the mail-server if you send mail out via port 25 directly, similar to the webserver flow. Anyway, point is TLS works great when it's used, but it's encryption only applies between the direct connection, not necessarily the full traffic route. You can use PGP / GPG to encrypt your mail itself, but each recipient needs the secret to decrypt your encrypted mail. If it helps, think of it this way:
|
Beta Was this translation helpful? Give feedback.
SSL/TLS is only used to encrypt the traffic between mail servers (or from a client to a server). Every mail server (MTA) gets the mail in plain text. It's not guaranteed, that every MTA to MTA connection is encrypted.
If only the receiver should be able to read the mail content, you should look into S/MIME or GPG/PGP.