Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I would like to ask what happens when an email is sent from gmail, yahoo or hotmail public web email services?

I don't understand email protocols in details, but as far as I know email traffic is unencrypted and the messages are passed along many mail servers (in plain text) before reaching their destination server. However, this was questioned recently by other people, and their view was that if one of the big providers is used, the email messages are encrypted and there is no need to worry about security.

Do you know if they are right about this and are emails moderately secure? Thank you!

share|improve this question
Can you clarify that you mean their public mail services, not their staff e-mail system? –  user185 Aug 23 '11 at 16:44

4 Answers 4

up vote 37 down vote accepted

An SMTP session between two mail servers may be encrypted, but only if both ends support it and if both ends choose to use it. So if you're sending mail from Gmail to example.net, then Google could only encrypt if example.net was ready and willing. For this reason, you cannot trust email to be even moderately secure at the transport layer. (The only safe end-to-end method is to encrypt your email using S/MIME or PGP, but the people you're exchanging email with need to be on board too... just like the mail servers).

As to whether the big three are performing opportunistic STARTTLS, I haven't seen any evidence of it, but I spend less time reading my mail server logs than I used to. And if they are, they're still only half of every SMTP connection they make, and cannot guarantee the use of encryption.


I just banner tested MX hosts for gmail.com, yahoo.com, and hotmail.com. Only gmail advertises STARTTLS, which is to say, only gmail would be willing to encrypt the SMTP session if the other party wanted to.

I tested gmail outbound by sending mail to a server I own and watching the wire; Google does indeed take advantage of STARTTLS if it is offered and encrypts the SMTP transaction when a gmail user is sending mail. Props to Google.

So as far as "sending" email encryption goes: Google 1, Yahoo 0, Microsoft 0.

As per the comments below, if you want to test these yourself, it's very simple:

  1. Determine the MX hosts (Mail eXchangers) for the domain
  2. Telnet to port 25 on one of them
  3. Type in "ehlo yourhostname.domain.com"
  4. If you don't see "250-STARTTLS" as one of the responses, they don't support opportunistic encryption.

Like this:

$ host -t mx yahoo.com
yahoo.com mail is handled by 1 mta5.am0.yahoodns.net.
yahoo.com mail is handled by 1 mta7.am0.yahoodns.net.
yahoo.com mail is handled by 1 mta6.am0.yahoodns.net.
$ telnet mta5.am0.yahoodns.net 25
Connected to mta5.am0.yahoodns.net.
Escape character is '^]'.
220 mta1315.mail.bf1.yahoo.com ESMTP YSmtpProxy service ready
ehlo myhost.linode.com
250-SIZE 41943040
221 mta1315.mail.bf1.yahoo.com
Connection closed by foreign host.

As a side note, Yahoo will close the connection if you don't ehlo right away. I had to cut & paste my ehlo because typing it in took too long.


As of January 2014, Yahoo is now encrypting - I just tested (as above) and verified. However, both The Register and Computerworld are reporting that the intracacies of SSL setup (such as Perfect Forward Secrecy) leave a lot to be desired as implemented by Yahoo.


Google is now including SMTP encryption data in their Transparency Report Safer Email section. They're sharing their data about who else is willing to encrypt, and you can look at the top numbers as well as query individual domains.

share|improve this answer
Thank you for the answer, it was very useful overview of the encryption possibilities! –  middlehut Aug 23 '11 at 7:25
+1 for mentioning PGP / S/MIME. –  tdammers Aug 23 '11 at 8:20
When the attacker answers to STARTTLS that it is not supported, gmail will continue unencrypted. –  Hendrik Brummermann Aug 23 '11 at 11:18
Could someone run this test again and see if Yahoo or MS has improved since 2011? Yahoo mail service is so bad I doubt they've changed. –  Lone Coder Dec 5 '13 at 18:56
I just retested (12/6/2013) and neither Yahoo or Hotmail are offering STARTTLS. The testing process is easy; I'll append it to the answer above so you can try yourself. –  gowenfawr Dec 6 '13 at 5:15

There are three points in the chain you need to consider: Transport between mail servers (e.g. between Google and example.org), transport between mail servers and clients, and the mail servers themselves.

Traffic between mail servers may or may not be encrypted; you shouldn't rely on it, and AFAIK, there is no way to enforce it from the client.

Traffic between clients and mail servers may or may not be encrypted; if you connect over SSL (either via a web interface or SMTP), your end of the chain is secure, but you can't say anything about the recipient. Conversely, if you're the recipient, you can fetch mail securely, but if the sender (or anyone in the CC/BCC) doesn't do the same, then there's your leak.

And finally, there's the mail servers themselves. If someone hacks into them, or social-engineers their way in, and the mail server stores content unencrypted, then again you're out of luck.

TL;DR: Unless you control the entire chain (both clients, and all mail servers involved), which is practically never the case, the only way to send emails with reliable security is to encrypt and decrypt locally, using something like PGP.

share|improve this answer

There's two different questions here:

  1. Does the email system allow emails to be sent to it over an encrypted channel and send email along an encrypted channel when the recipient's mail server supports it.
  2. Does the email system encrypt the contents of a mailbox when displaying it to the owner.

gownfawr addresses (1) well.

Gmail does encrypt via default for (2) so when viewing your mail, by default it is done via HTTPS, so a snooper will not be able to observe gmail sending the mail to your browser. I believe the others have not yet followed suite. (Full disclosure, I work for Google).

Gmail is set to use the 'Always use https' setting by default, ...

"Make Your Webmail More Secure" has instructions for avoiding plain-text reads of a mailbox for a number of large webmail providers, but I cannot vouch for it being up-to-date.

share|improve this answer
+1 good separation of the two aspects. Pretty certain the answer to 1 is "Not by default, but all 3 will do this if required and both ends support it, and (where relevant) keys have been exchanged" –  Rory Alsop Aug 22 '11 at 23:01
Thank you for the answer! About the ecnryption - I was asking for the messages when they are sent by the mail server, not for the user interface which is used by end-users to check their inbox. It was valuable for me to understand that only 2 mail servers are involved. –  middlehut Aug 23 '11 at 7:23
Actually, it is common for more than 2 servers to be involved. I just reviewed 56 messages in my inbox: 7% had one "hop" (two servers), 18% had two hops, 57% had three hops, 2% had four hops, 4% had 5 hops, and 12% had 6 hops. One hop may represent client-to-SMTP-server, but the rest will be server-to-server. (The 6's are all Yahoo mail, which bounces around inside Yahoo using NNFMP before going out; I don't know but suspect that NNFMP doesn't support encryption). –  gowenfawr Aug 23 '11 at 12:39
@gowenfawr, thanks for explaining. The lack of encryption within Yahoo is less worrying than outside since there are fewer potential observers inside Yahoo's firewall. –  Mike Samuel Aug 23 '11 at 16:22
Other potential reasons for multiple mail hops include divisional mail routing (e.g., big companies, one domain, many sites and organizations), anti-SPAM services (e.g., Cloudmark, Postini), anti-SPAM and anti-Virus gateways (Barracuda). To see where your mail has been, look at the headers; there will be multiple "Received:" headers. Each time a mail server accepts a mail message, it adds its own "Received" header, so each one represents a hop, and you can see what servers (name and/or IP and sometimes software) touched your email. Some will also note if they used SSL for that hop. –  gowenfawr Aug 23 '11 at 21:49

You can test for yourself by using the websites mentioned at Test STARTTLS configuration of SMTP server. Be sure to test both receiving and sending.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.