Email Protocols
Moving a message into another person's inbox: SMTP transfer, IMAP and POP3 retrieval, SPF, DKIM and DMARC sender checks, and S/MIME signing. Interviewers test protocol reasoning on a federated system.
on this pageshowhide
explore
- SMTP29 questions
- Command/Reply Sequence6 questions
- Envelope vs From Header5 questions
- Relaying and MX Routing6 questions
- STARTTLS, MTA-STS & DANE6 questions
- Submission Auth & Bounces6 questions
- IMAPempty
- Server-Side Searchempty
- POP35 questions
- SPF21 questions
- TXT Record Syntax5 questions
- Mechanisms & Qualifiers6 questions
- 10-Lookup Limit4 questions
- Results & Forwarding Breakage6 questions
- DKIM27 questions
- Message Signing6 questions
- Selectors & Key Records6 questions
- Canonicalization & Body Length5 questions
- Signature Verification5 questions
- Key Rotation5 questions
- DMARC28 questions
- Identifier Alignment6 questions
- Policy Record Tags5 questions
- Policies & Subdomains6 questions
- Aggregate & Failure Reports5 questions
- Rollout & Operations6 questions
- S/MIME32 questions
- CMS SignedData5 questions
- CMS EnvelopedData6 questions
- Mailbox Certificate Profile5 questions
- Certificate Discovery and Trust6 questions
- Private Key Custody5 questions
- OpenPGP Comparison5 questions
questions
142 · 6 sectionsWhy does SMTP mail submission get its own port 587, and how does a submission agent differ from the MTA on port 25?
basics
~20 sPort 587 is RFC 6409's submission port: its submission agent accepts new mail only from authenticated users and may complete the message. Port 25 carries relay between MTAs, takes unauthenticated senders, and should accept mail only for domains it serves.
In SMTP, what do a reply code's first and second digits mean, and how does an enhanced status code such as 5.1.1 refine them?
basics
~20 sAn SMTP reply's first digit gives the outcome: 2 done, 3 send more, 4 temporary failure worth retrying, 5 permanent failure. The second digit names the category, and an enhanced code like 5.1.1 adds class, subject and detail.
In SMTP, how does the envelope sender given in MAIL FROM differ from the From header a recipient sees?
basics
~20 sMAIL FROM is the envelope reverse-path, sent in the SMTP dialog and used for bounces; From is the author's address inside the message content. RFC 5321 requires no relationship between them, so they can differ.
What is the difference between an open SMTP relay and a mail server that relays only for authenticated clients or trusted networks?
basics
~20 sAn open relay accepts mail from any client for any destination. A correctly run MTA relays to outside domains only for authenticated clients or trusted networks, and accepts everything else only for domains it serves.
Why does opportunistic STARTTLS between mail servers not guarantee an encrypted, authenticated hop, and what can a domain do about it?
basics
~20 sThe STARTTLS offer arrives in cleartext, so an on-path party can remove it and the sender, by design, carries on unencrypted; opportunistic senders also accept any certificate. MTA-STS, DANE or per-destination mandatory TLS make the hop required and authenticated.
Under POP3 (110/995), why does mail the office desktop has downloaded never show up on staff phones, and what does IMAP (143/993) do instead?
basics
~20 sPOP3 is download-and-delete: the desktop retrieves each message and deletes it from the server at QUIT, so the phone finds nothing. IMAP keeps mail on the server for every device. Ports: POP3 110/995, IMAP 143/993.
Under RFC 1939, when does a POP3 DELE actually remove a message, and what happens if the connection drops before QUIT?
basics
~20 sDELE only marks a message; the server removes marked messages when QUIT moves the session from TRANSACTION into the UPDATE state. If the connection drops or times out first, the session never enters UPDATE and nothing is removed.
For POP3 access to a mail service offering port 110 with STLS and port 995, which should clients use, and why does RFC 8314 prefer it?
basics
~20 sUse port 995: POP3S starts TLS before any POP3 command, so nothing travels in cleartext. RFC 8314 (2018) prefers it to STLS on 110, whose cleartext start a client may fail to upgrade, and treats cleartext login as obsolete.
Should an office keep any POP3 access when staff read mail on several devices, and which POP3 and IMAP ports would you leave open?
basics
~20 sUsually make IMAP on 993 the default and retire POP3 for people; keep POP3 only on 995 for a named single-consumer case, such as a system draining a mailbox, and close cleartext 110 and 143 once nothing needs them.
How does a POP3 client leave mail on the server using UIDL, and why does that only partly imitate IMAP's server-side mailbox?
basics
~20 sThe client skips DELE and records each message's UIDL unique-id, downloading only ids it has not seen. The server keeps one flat maildrop with no shared read state or folders, so read state and filing never carry from one device to another.
In DNS, which record type carries a domain's SPF policy, and what must the policy's first and last terms be?
basics
~20 sAn SPF policy is published only as a DNS TXT record at the name it covers. Its text must begin with exactly v=spf1, and it should end with an all mechanism that sets the explicit default result.
What are the seven results an SPF check can return, and how does a receiving mail server typically handle each one?
basics
~20 sSPF returns pass, fail, softfail, neutral, none, temperror or permerror. RFC 7208 leaves the action to the receiver: it may reject fail, should not reject on softfail alone, must treat neutral like none, and may defer temperror.
What does an SPF record ending in +all authorise, and how do its qualifiers and left-to-right matching produce a result?
basics
~20 sAn SPF record ending in +all authorises every IP address: all always matches and + makes a match pass. Mechanisms are tried left to right; the first match's qualifier (+ pass, - fail, ~ softfail, ? neutral) is the result.
Why does adding a second v=spf1 TXT record at the same domain break SPF for all of its mail, and how do you fix it?
basics
~20 sRFC 7208 allows one record beginning v=spf1 per name; when a receiver selects two, the check returns permerror for every message from that domain. The fix is to merge both into one record with a single all at the end.
Why does SPF fail for mail forwarded through an alias, such as an alumni address, when the original sender's record is correct?
basics
~20 sSPF checks the IP of the server that connected last. A plain forwarder resends from its own IP but keeps the original MAIL FROM, so the receiver checks the sender's record, which never listed the forwarder.
Given a DKIM-Signature with d=example.com and s=s2026a, where does a receiver look up the public key, and what must that record contain?
basics
~20 sThe receiver queries the TXT record at s2026a._domainkey.example.com: the s= selector, the fixed _domainkey label, then the d= domain. The value is a tag list whose only required tag is p=, the base64 public key.
When a sending mail server DKIM-signs a message, what exactly does it hash, what does it sign, and where does each result go?
basics
~20 sA DKIM signer hashes the body into bh=, then hashes the header fields listed in h= plus its own DKIM-Signature field with b= left empty, signs that hash with the domain's private key, and writes the result into b=.
What does a DKIM fail result tell a receiver about a message, and why is it treated like an unsigned message?
basics
~20 sDKIM fail means a checkable signature did not match the message as received, so it vouches for nothing. It is not proof of forgery: relays that modify mail break honest signatures, so RFC 6376 says treat it like an unsigned message.
In DKIM, what exactly do the simple and relaxed canonicalization algorithms change for header fields and for the message body?
basics
~20 sSimple hashes headers byte for byte; relaxed lowercases field names, unfolds lines, collapses whitespace runs to one space and trims it at the colon and value end. Both body algorithms drop trailing empty lines; relaxed also strips line-end whitespace and collapses runs.
When rotating a DKIM signing key by selector, in what order do you publish, switch and retire, and why does the old record stay published?
basics
~20 sPublish the new key under a new selector, confirm it resolves, switch signing, keep the old record until queued and late-verified mail has cleared, then revoke the old record with an empty p= and destroy the old private key.
What is the difference between DMARC aggregate reports and DMARC failure reports, and which one does a domain owner rely on?
basics
~20 sAggregate reports (RFC 9990, requested with rua) are daily XML summaries of SPF, DKIM and alignment results per sending IP, with no message content; failure reports (RFC 9991, requested with ruf) are per-message ARF samples, and most receivers send none.
Under RFC 9989, what must a DMARC policy record at _dmarc.example.com contain to be valid, and what does the smallest useful one say?
basics
~20 sA DMARC record must begin with v=DMARC1, spelled exactly, or receivers ignore it, and should carry p=none, quarantine or reject. The smallest useful one is v=DMARC1; p=none; rua=mailto: plus a report mailbox: monitoring with aggregate reports.
Under DMARC, what do the policies none, quarantine and reject ask a receiving mail server to do with a message that fails DMARC?
basics
~10 sThey state the From domain owner's preference for failing mail: none asks for no change, quarantine for treating it as suspicious, reject for refusal during the SMTP session. The receiver's local policy still decides.
Why does a domain whose DMARC record publishes p=none get no protection against messages forging its From address?
basics
~20 sp=none expresses no handling preference, and RFC 9989 says a discovered p=none MUST NOT change how receivers handle mail, so a forged message is treated as if the domain had no DMARC policy. It buys visibility through reports, not protection.
What did Gmail's and Yahoo's 2024 bulk-sender rules require of a sending domain's DMARC, and does p=none satisfy them?
basics
~20 sFrom February 2024 both providers require bulk senders to authenticate with SPF and DKIM, publish a DMARC record (p=none accepted) and send mail whose From domain aligns with SPF or DKIM. p=none meets the record rule but stops no forgery.
When a sender S/MIME-encrypts a message to a colleague, whose key protects it, whose private key opens it, and what stays readable in transit?
basics
~20 sS/MIME encryption uses each recipient's certificate to protect a random content key, which only that recipient's private key can recover. Body and attachments are hidden end to end; the envelope and outer headers such as From, To and Subject stay readable.
In S/MIME, why does losing your private decryption key cut you off from old encrypted mail, while losing your signing key does not?
basics
~20 sS/MIME mail is usually stored still encrypted, and only the recipient's private decryption key unwraps each message's content key, so losing it loses the archive. Signatures verify with the signer's public key, so old signing keys are not needed.
What does an S/MIME signature on an email show the recipient that the sending domain's DKIM signature does not?
basics
~20 sAn S/MIME signature is made with the author's own private key and verified with a certificate naming the author's mailbox, so it ties the message body to that person. A DKIM signature ties the message only to the sending domain.
In S/MIME, why can you sign a message to anyone but encrypt only to correspondents whose certificate your mail client already holds?
basics
~20 sSigning uses your own private key, which you always hold. Encryption wraps the message key under each recipient's public key, found in their certificate, so the client must first obtain and trust it, usually from a signed message they sent.
In mail encryption, how does S/MIME's CA-issued identity differ from OpenPGP's web of trust when deciding a correspondent's key is genuine?
basics
~20 sS/MIME trusts a key because a certification authority the client already trusts issued a certificate binding it to the mailbox. OpenPGP users create their own keys, and each receiver decides validity from certifications by people it trusts or its own checks.