Email, explained

Email, explained

How email actually works, why mail servers are so easy to get wrong, what fifty years of fixes have solved, and what is still broken. Written for anyone who has tried to run a mail server, or wondered why it is so hard.

It is the guide we wished we had when we were learning. It is written to be useful whatever server you run; REST Mail's own approach comes last in each chapter, after the problem and the standard fixes, never instead of them.

Each chapter follows the same pattern:

  1. The problem. What goes wrong without this, in plain words.
  2. How it works. The protocol or setting, with a diagram.
  3. What goes wrong. The common mistakes, and why they are easy to make.
  4. How REST Mail handles it. With links to the code that does it.
  5. Sources. The RFCs and documentation every claim comes from.

These files are the source of truth. The guide on rest-mail.com is built from them, with the diagrams made interactive, so the two never drift apart. How that build works is being designed in docs/design/email-explained-website.md.

Part 1: How email works

Part 2: The security layers, one at a time

Part 3: How it goes wrong

Part 4: The landscape, and where REST Mail fits

Reference

See WRITING.md for the chapter pattern, how sources are cited, and how diagrams are made.