Simple mail transfer protocol smtp
This presentation is the property of its rightful owner.
Sponsored Links
1 / 29

Simple Mail Transfer Protocol (SMTP) PowerPoint PPT Presentation


  • 100 Views
  • Uploaded on
  • Presentation posted in: General

Simple Mail Transfer Protocol (SMTP). Kanika Thapar CISC 856 TCP/IP and Upper Layer Protocols 11/8/2007 (Some slides provided by Ezra Kissel, some figures taken from Forouzan’s book). Overview. Introduction Sendmail How SMTP works? SMTP data transfer Examples Limitations & extensions

Download Presentation

Simple Mail Transfer Protocol (SMTP)

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Simple mail transfer protocol smtp

Simple Mail Transfer Protocol(SMTP)

Kanika Thapar

CISC 856 TCP/IP and Upper Layer Protocols

11/8/2007

(Some slides provided by Ezra Kissel, some figures taken from Forouzan’s book)


Overview

Overview

  • Introduction

  • Sendmail

  • How SMTP works?

  • SMTP data transfer

  • Examples

  • Limitations & extensions

  • Retrieving mail (Mailbox protocols)


Simple mail transfer protocol smtp

Introduction


Simple mail transfer protocol smtp

Collects mail and delivers to user agent

Transfers mails from one host to another

Introduction…

Transfers mails from one host to another

Collects mail and delivers to user agent

Composes, reads,

replies to

,forwards and handles mailboxes


Simple mail transfer protocol smtp

Message transfer…

SMTP is a push protocol


Sendmail

Sendmail

  • Mail Transfer Agent [MTA] : is a computer program or software agent that transfers electronic mail messages from one computer to another.

  • Sendmail is a MTA

  • Supports several mail transfers including SMTP

  • Pro’s

    • Can perform header rewriting, mail routing

    • Extensive support available

  • Con’s

    • Not secure

    • Code is bulky [compared to other MTA’s such as qmail]


Simple mail transfer protocol smtp

SMTP server can also assume the role of a “relay”

SMTP mail gateways are used to transport mail prepared by a protocol other than SMTP

Relays and Gateways

Non-SMTP supported

SMTP supported


Simple mail transfer protocol smtp

How SMTP works?

Command format:

Keyword: argument(s)

Response format:

3-digit status code [textual information]

Link Layer PCI

Link Layer PCI

IP-PCI

IP-PCI

TCP-PCI

TCP-PCI

TCP-PCI

SMTP command/response

SMTP command/response

SMTP command/response


Simple mail transfer protocol smtp

SMTP A-PDU’s

The Basics

The Extras


Simple mail transfer protocol smtp

How SMTP works : Status Codes

The Server responds with a 3 digit code that may be followed by text info

  • 2## - Success

  • 3## - Command can be accepted with more information

  • 4## - Command was rejected, but error condition is temporary

  • 5## - Command rejected, Bad User!


Simple mail transfer protocol smtp

Traditional mail vs email

E-mail envelope and body

Traditional mail envelope and body


Connection establishment

Connection Establishment

SYN

SYN+ACK

Ephemeral port

Ephemeral port

Port 25

Port 25

SYN


Simple mail transfer protocol smtp

Ephemeral port

Port 25


Connection termination

Connection Termination

Ephemeral port

Port 25

FIN

ACK

RESET


Simulating mta client using telnet

Simulating MTA client using telnet

% telnet mail.adelphia.net 25Trying 68.168.78.100...Connected to mail.adelphia.net (68.168.78.100).

================== ConnectionEstablishment================

220 mta13.adelphia.net SMTP server ready Thur, 8 Nov 2007 ..HELO mail.adelphia.net250 mta13.adelphia.net

=====================Envelope==========================

MAIL FROM: [email protected] Sender <[email protected]> OkRCPT TO: [email protected]

250 Recipient <[email protected]> Ok


Simulating mta client using telnet1

Simulating MTA client using telnet

=================== Header and Body ===================

DATA354 Ok Send data ending with <CRLF>.<CRLF>From: ForouzanTO: ThaparThis is a test messageto show SMTP in action..

250 Message received: [email protected]

============= Connection Termination====================

QUIT

221 mta13.adelphia.net SMTP server closing connection

Connection closed by foreign host.


Limitations in smtp

Limitations in SMTP

  • Only uses NVT 7 bit ASCII format

    • How to represent other data types?

  • Susceptible to misuse (Spamming,

    faking sender address)


Solution smtp extensions

Solution: SMTP extensions

  • MIME – Multipurpose Internet Mail Extensions

    Transforms non-ASCII data to NVT (Network Virtual Terminal) ASCII data


Mime headers

MIME headers


Mime headers cont d

MIME headers (cont’d)

  • Content-Type – Type of data used in the Body

    • Text: plain, unformatted text; HTML

    • Multipart: Body contains different data types

    • Message: Body contains a whole, part, or pointer to a message

    • Image: Message contains a static image (JPEG, GIF)

    • Video: Message contains an animated image (MPEG)

    • Audio: Message contains a basic sound sample (8kHz)

    • Application: Message is of data type not previously defined

  • Content-Transfer-Encoding – How to encode the message

    • 7 bit – no encoding needed

    • 8 bit – Non-ASCII, short lines

    • Binary – Non-ASCII, unlimited length lines

    • Base64 – 6 bit blocks encoded into 8-bit ASCII

    • Quoted-printable – send non-ASCII characters as 3 ASCII characters


Base64 encoding

Base64 Encoding

  • Divides binary data into 24 bit blocks

  • Each block is then divided into 6 bit chunks

  • Each 6-bit section is interpreted as one character

11001100 10000001 00111001

110011 001000 000100 111001

(51)

(8)

(4)

(57)

(z)

(I)

(E)

(5)

01111010

01001001

01000101

00110101


Simple mail transfer protocol smtp

Base64 Encoding table


Simple mail transfer protocol smtp

Multipart, Encoded MIME Message

From: Kanika Thapar <[email protected]>

To: [email protected]

Subject: attachment test

MIME-Version: 1.0

Content-Type: MULTIPART/MIXED; boundary="MIMEStream=_0+92061_793033260215529_597673089"

--MIMEStream=_0+92061_793033260215529_597673089

Content-Type: TEXT/PLAIN; charset="US-ASCII"; format=flowed

There is an image attached...

--MIMEStream=_0+92061_793033260215529_597673089

Content-Type: IMAGE/jpeg; name="test.jpg"

Content-Transfer-Encoding: base64

Content-Disposition: attachment; filename="test.jpg"

/9j/4AAQSkZJRgABAgEASABIAAD/4QNxRXhpZgAATU0AKgAAAAgABwESAAMA

AAABAAEAAAEaAAUAAAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAEx

osv/0I5nPvr7sVdirsVf/9GO5z76+6hxQ1il2Kv/0o5nPvr7eKtYq7FX/9k=

--MIMEStream=_0+92061_793033260215529_597673089--


Mail access protocols pop3 imap4

Mail Access Protocols POP3 & IMAP4

POP3

IMAP4

SMTP

SMTP


Simple mail transfer protocol smtp

POP3


Simple mail transfer protocol smtp

Post Office Protocol v3

  • Allows the user to obtain a list of their Emails

  • Users can retrieve their emails

  • Users can either delete or keep the email on their system

  • Minimizes server resources


Simple mail transfer protocol smtp

Internet Mail Access Protocol v4

  • User can check the email header before downloading

  • Can search the email for a specific string of characters before downloading

  • User can download parts of an email

  • User can create, delete, or rename mailboxes on a server


Quoted printable encoding

Quoted-Printable Encoding

  • Used when the data has a small non-ASCII portion

  • Non-ASCII characters are sent as 3 characters

  • First is ‘=‘, second and third are the hex representation of the byte

  • =##, ## is the hex representation of the byte

01001100 10011101 00111001

(=)

(9)

(D)

00111101

00111001

01000100


Ascii table

ASCII table


  • Login