CSS Prepare

optional · CSS study notes

Email — SMTP, POP3 & IMAP

🧭

On this page — click any heading below to jump straight to it. ⬅️ Back to P-II.II. Computer Communications & Networks


OSI Layer: Application Layer (L7)

Definition

Electronic mail delivery relies on three cooperating application-layer protocols: SMTP for sending/relaying mail between servers, and POP3 or IMAP for a client retrieving mail from its mailbox on a server.

Three Major Components

  • User agent ("mail reader") — Outlook, Gmail web client, Thunderbird — for composing, reading, replying
  • Mail server — holds mailboxes and runs a message queue for outgoing mail
  • SMTP (Simple Mail Transfer Protocol) — transfers mail from the sender's mail server to the recipient's mail server (and from the user agent to the sender's server); port 25 (587 for authenticated submission)

SMTP Characteristics

  • A push protocol — the client pushes the message to the server
  • Runs over TCP for reliable delivery
  • Uses commands like HELO/EHLO, MAIL FROM, RCPT TO, DATA
  • Historically restricted to 7-bit ASCII — MIME (Multipurpose Internet Mail Extensions) extends it to carry attachments, images, and non-ASCII text

Mail Access Protocols (Pull Protocols)

  • POP3 (Post Office Protocol v3, port 110) — simple; typically downloads messages to the client and deletes them from the server (though a "leave a copy" option exists); poor support for folders/state across sessions; suits a single device
  • IMAP (Internet Message Access Protocol, port 143) — messages remain on the server; supports folders, flags (read/unread), partial downloads, and synchronized state across multiple devices — the modern default for accessing mail from a phone and laptop simultaneously
  • Both are pull protocols — the client actively contacts the server to retrieve waiting mail, unlike SMTP's push model

Comparison Table

BasisSMTPPOP3IMAP
DirectionPush (send)Pull (retrieve)Pull (retrieve)
Port25 / 587110143
Mail storageN/A (transit only)Typically downloaded, deleted from serverStays on server, synced across devices
Multi-device useN/APoorExcellent
ComplexityModerateSimpleHigher (stateful)

CSS Exam Angle

  • The classic question is "explain the role of SMTP, POP3 and IMAP in email" with a labelled diagram (user agent → sender's server via SMTP → receiver's server via SMTP → user agent via POP3/IMAP)
  • Be explicit about push vs pull — a common short-question distinction
  • Mention MIME as the reason attachments/images can travel over an ASCII-only protocol

Example

When someone in Islamabad emails a friend in Karachi with a photo attached, their mail client uses SMTP to push the MIME-encoded message to their own provider's mail server, which relays it via SMTP to the friend's provider's server; the friend's phone and laptop both then use IMAP to pull and keep the same read/unread status in sync across both devices.

Likely Questions

  1. Explain the architecture of an email system: user agents, mail servers, and SMTP.
  2. Differentiate SMTP from POP3/IMAP as push vs pull protocols.
  3. Compare POP3 and IMAP — which suits a multi-device user better, and why?
  4. What is MIME and why is it needed alongside SMTP?

📜 Past-Paper Questions & Structured Answers

Questions are paraphrased; answer focus is suggested guidance, not an official marking scheme.

2025 · Paper-II · Q3(a)(iv) · shared application-protocol question · 2 marks

Question (paraphrased): Explain the conventional TCP choice for HTTP, FTP, SMTP and POP3.

Answer focus: Reliability/order + responsibility removed from the application.

TCP delivers an ordered byte stream and recovers lost data through acknowledgements and retransmission. That suits mail commands and message content, which must not silently lose or rearrange bytes; plain UDP would require the application to supply those functions.

SMTP transfers/submits mail; POP3 retrieves it. They do different jobs even though both conventionally use TCP.

Related port question: 2020 Paper-I Q3(a), four marks for five services, includes SMTP: 25 for server-to-server transfer. The full answer is in Servers, Server Types & Protocol Stack. No standalone POP3-versus-IMAP descriptive question was located in the reviewed set; the comparison above remains syllabus preparation.