Simple Mail Transfer Protocol

Mail RFCs (1)

Mail RFCs (2)

SMTP Server

Session Initialion

  • C->S Connect TCP 25
  • S->C 220 greeting message

Client Initiation

  • C->S EHLO Client Identiy
  • S->C 250 Server Idenity + ESMTP Capabilities

Mail Transactions (1)

  • C->S MAIL From: sender
  • S->C 250 Ok
  • C->S RCPT To: recipient
  • S->C 250 Ok

Mail Transactions (2)

  • C->S DATA
  • S->C 354 End data with .
  • C->S (message)
  • C->S .
  • S->C 250 Ok

Session Close

  • C->S QUIT
  • S->C 221 Bye

Debugging Commands

  • EXPN ... Expand (list address)
  • VRFY ... Verify (e-mail address)
  • almost always disabled

SMTP Relay

  • Relay to internal SMTP servers
  • Relay to non-IP email system
    • Historical ... @BITNET
    • X.400 MHS
  • From internal users to the Internet

Received headers

  • When forwarding a message, a gateway MUST prepend a Received: line
  • but it MUST NOT alter in any way a Received: line that is already in the header section.

Other SMTP Commands

  • HELO ... Older EHLO
  • RSET (reset)
  • HELP/NOOP

SMTP Response Code (1)

  • 2yz ... Positive Completion reply
  • 3yz ... Positive Intermediate reply
  • 4yz ... Transient Negative Completion reply
  • 5yz ... Permanent Negative Completion reply

SMTP Response Code (2)

  • x0z Syntax related
  • x1z Informational
  • x2z Connections related
  • x5z Mail system related

Reply continuation

  • Example:
       250-First line
       250-Second line
       250-234 Text beginning with numbers
       250 The last line
    

Command-Reply Sequences

Size and Timeouts

Locating Servers

  • DNS MX record
  • or A/AAAA record

SMTP Authentication

Outbound Port 25 blocking

  • ISP users can send Spam directly to an outer SMTP server
  • Prevent this by blocking TCP port 25
  • Mobile users can use mail submission agent (port 587) with authentication

Quiz of the day

  • What is the number of TCP port in following message agents
  • Message Transfer Agent
  • Message Submission Agent

Homework

  • Use "telnet is01 25" to connect our mail server and send yourself an e-mail message.
  • Record the transaction and view the source of the message you've received.
  • Include both the transaction and the message source in your report.