How Email Works
YOU GOT A MAIL!
1. Overview
- Format
- Header
- Process of Sending
- 3 protocols: SMTP, POP3, IMAP
2. Decription
Email generally follow a format called IMF (Internet Message Format). It is a set of rule of how an email meesage must follow (like From:, To:, Subject:)
Received - the last hop before it reaches your email server (the is the ONLY header that can be trusted, other fields can be masqueraded)
Return Path - the return email addr if the email fails to delivered
Replay-To - The addr when users hit reply
X-Originating-ip - sender’s ip
- The Bottom-Up Rule: Read them from bottom to top. The top-most is the last server receiving it.
2.3 Process of Sending
- Client to Server: Your email client (like Gmail or Outlook) connects to your email provider’s outgoing mail server (the SMTP server) and hands off the message.
- Routing: Your SMTP server looks up the recipient’s domain to find their mail server’s address using the Domain Name System (DNS) and its MX Record (Mail Exchanger).
- Server to Server: Your SMTP server connects to the recipient’s mail server (also using SMTP) and transfers the email.
- Delivery: The recipient’s mail server accepts the message, runs checks (spam, virus), and places it in the recipient’s digital mailbox.
- Retrieval: The recipient’s email client later connects to their mail server (using POP or IMAP) to retrieve and display the message.
2.4 Protocols
- For Sending:
- SMTP is the only choice (port 25, and 587 for Secure Transport)
- For Reseiving:
- IMAP - the mail stay on server. Users can view mail from different devices.
- POP3 - the users download the mails, and they will get deleted from servers.
3. Extended Readings
last modified: 2025-12-12