Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sending and Receiving Mails

Similar presentations


Presentation on theme: "Sending and Receiving Mails"— Presentation transcript:

1 Sending and Receiving Mails

2 SMTP (Simple Mail Transfer Protocol)
POP3 (Post Office Protocol version 3) IMAP4 (Internet Message Access Protocol version 4) MIME (Multipurpose Internet Mail Extension)

3 SMTP RFCs RFC 821: Simple Mail Transfer Protocol Related RFCs
RFC 822 (Standard for the format of ARPA Internet text messages) RFC 1521 (MIME) RFC (POP3) RFC (IMAP4) Well known port : 25 (TCP)

4 ESMTP Extended Simple Mail Transfer Protocol
RFC 1869: SMTP Service Extensions RFC 1870: SMTP Service Extension for Message Size Declaration RFC 1891: SMTP Service Extension for Delivery Status Notifications RFC 2554: SMTP Service Extension for Authentication Two major differences from SMTP: Support 8-bit MIME encoding Support SMTP authorization

5 SMTP: Simple Mail Transfer Protocol
Three Components: user agents: “mail readers” mail servers: “mailbox; mail queue” smtp: simple mail transfer protocol protocol between mail servers protocol between mail the server and the client

6 SMTP: agents/servers user agents: “mail readers” mail servers:
composing, editing, reading mail messages e.g., Outlook, Eudora, pine, elm, Netscape Messenger send and receive outgoing and incoming messages to mail server mail servers: mailbox: contains incoming messages (yet to be read) for user message queue: contains outgoing (to be sent) mail messages

7 SMTP Process Contact server on well known port (25)
ASCII oriented command/response methodology contact server wait for greeting send HELO wait for response send command repeat last two

8 SMTP Commands HELP MAIL RCPT DATA
identifies the client to the server, fully qualified domain name, only sent once per session MAIL initiate a message transfer, fully qualified domain of originator RCPT follows MAIL, identifies an addressee, typically the fully qualified name of the addressee for multiple addressees use one RCPT for each addressee DATA send data line by line <cr>.<cr> tells server data transfer is over

9 SMTP Commands RSET SEND , SOML , SAML VRFY EXPN
tells server to abort current message and clear all of it buffers same state as after HELO SEND , SOML , SAML like MAIL, outdated not used any more VRFY ask server to verify a user name server replies positively of it knows user, negatively if not EXPN ask server to confirm mailing list alias server reply is multi-line, one per user

10 SMTP Commands HELP NOOP QUIT TURN ask server for help
by itself get a list of server supported commands <string> get help for that command NOOP ask server to respond with a positive reply QUIT tell server that client is ending session server replies positively and closes connection TURN reverse roles of client and server outdated, rarely used on modern internet

11 Reply codes 211 - System status or help ready 214 - Help message
220 - <domain> Service ready 221 - <domain> Service closing transmission channel 250 - Requested mail action OK, ready 251 - User not local, will forward to <forward path> 354 - Start mail input; end with <crlf>.<crlf> 421 - <domain> Service not avail, closing transmission channel 450 - Requested mail action not taken, mailbox not available 451 - Requested action aborted, local error 452 - Requested action not taken, insufficient storage 500 - Syntax error, command unrecognized 501 - Syntax error in parameters 502 - Command not implemented 503 - Bad sequence of commands 504 - Command Parameter not implemented

12 Reply codes (more) 550 - Requested action not taken, mailbox unavailable 551 - User not local, please try <forward path> 552 - Requested mail action not taken; exceeded storage allocation 553 - Requested action not taken, mailbox name not allowed 554 - Transaction failed

13 Reply Code (more) 353 Indicates success, failure, or incomplete
The category of error message The specific message for that category 첫번째 1-3 Success 4. Temp negative 5 failure 두번째 0 syntax 2 connection 5 mail Expn 모두 보여줌.. (그룹 지정시) 일반적으로 모두 disable 됨(보안적 문제)

14 SMTP: Example mail from:javamail@csie.ncu.edu.tw
telnet smtp.csie.ncu.edu.tw 25 220 relay2.csie.ncu.edu.tw ESMTP Sendmail / ; Thu, 11 Mar :54: (CST)220 mailServer.iitb.edu helo smtp.csie.ncu.edu.tw 250 relay2.csie.ncu.edu.tw Hello adsl HCON.sparqnet.net [ ], pleased to meet you mail Sender ok rcpt Relaying denied. Proper authentication required. rcpt Recipient ok

15 SMTP: Example (more) data
354 Please start mail input. date: subject: This is a test. from: to: reply-to: Hi, JR This is a test. . 250 Mail queued for delivery. quit 221 Closing connection. Good bye.

16 ESMTP: Example telnet smtp.csie.ncu.edu.tw 25
220 relay2.csie.ncu.edu.tw ESMTP Sendmail / ; Thu, 11 Mar :54: (CST)220 mailServer.iitb.edu ehlo smtp.csie.ncu.edu.tw 250-relay2.csie.ncu.edu.tw Hello adsl HCON.sparqnet.net [ ], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-AUTH LOGIN PLAIN 250-STARTTLS 250-DELIVERBY 250 HELP

17 ESMTP: Example help 214-2.0.0 This is sendmail version 8.12.11
Topics: HELO EHLO MAIL RCPT DATA RSET NOOP QUIT HELP VRFY EXPN VERB ETRN DSN AUTH STARTTLS For more info use "HELP <topic>". To report bugs in the implementation send to For local information send to Postmaster at your site. End of HELP info

18 Mail message format header lines:
RFC 822: Standard for the format of ARPA Internet text messages header lines: Date: From: To: Reply-to: Subject: etc...

19 Multimedia extensions
additional lines in message header declare MIME content type MIME version From: To: Subject: Picture. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data ..... ......base64 encoded data . method used to encode data multimedia datatype, parameter declaration encoded data

20 MIME [RFC 2045, 2056] MIME: Multimedia Extension Types:
Text: subtypes: plain, html Image: subtypes: jpeg, gif Audio: subtypes: basic (8-bit mu-law encoded), 32kadpcm (32 kbps coding) Video: example subtypes: mpeg, quicktime Application: other data that must be processed by reader before “viewable”; example subtypes: msword, octet-stream

21 POP3 POP3(Post Office Protocol 3) defined RFC1939 Used TCP port 110
No state information between client and the mail server Client side mail management No security POP3 progresses through three phases Authorization – user / pass Transaction – list / retr / dele / stat Update – quit Two Operation modes Download-and-delete mode Download-and-keep keep

22 POP3 Commands USER name valid in the AUTHORIZATION state PASS string
QUIT STAT valid in the TRANSACTION state LIST [msg] RETR msg DELE msg NOOP RSET QUIT valid in the UPDATE state

23 POP3 Replies +OK -ERR

24 POP3 Hamburger</home/staff/hkkim>9% telnet rtlab.skku.ac.kr 110
Trying Connected to rtlab.skku.ac.kr. Escape character is '^]'. +OK Qpopper (version 4.0.3) at imtl.skku.ac.kr starting. user hkkim +OK Password required for hkkim. pass tlftlrks +OK hkkim has 3 visible messages (0 hidden) in 3043 octets. list +OK 3 visible messages (3043 octets) 1 1483 2 780 3 780 . retr 1 +OK 1483 octets Received: from brunhild ([ ……… dele 1 +OK Message 1 has been delted. quit +OK Pop server at imtl.skku.ac.kr signing off. Connection closed by foreign host. Download-and-delete Authorization Transaction Update

25 Term project problems Design a sending mail program supporting ESMTP AUTH Design a receiving mail program supporting MIME


Download ppt "Sending and Receiving Mails"

Similar presentations


Ads by Google