110 likes | 574 Views
Simple Mail Transfer Protocol (SMTP). CS-328 Dick Steflik. SMTP RFCs. RFCs - 821, 1870, 1891 Related RFCs RFC 822 (Mail) RFC 1521 (MIME) RFC - 1725 (POP3) RFC - 1730 (IMAP4) Well known port : 25 (TCP) . SMTP Process. Contact server on well known port ASCII oriented command/response
E N D
Simple Mail Transfer Protocol(SMTP) CS-328 Dick Steflik
SMTP RFCs • RFCs - 821, 1870, 1891 • Related RFCs • RFC 822 (Mail) • RFC 1521 (MIME) • RFC - 1725 (POP3) • RFC - 1730 (IMAP4) • Well known port : 25 (TCP)
SMTP Process • Contact server on well known port • ASCII oriented command/response • methodology • contact server • wait for greeting • send HELO • wait for response • send command • wait for response • repeat last two
SMTP Commands HELO <sp> <domain><crlf> MAIL <sp>FROM:<reverse path><crlf> RCPT <sp>TO:<forward path><crlf> DATA<crlf> terminates with <crlf>.<crlf> RSET<cflf> SEND<sp>FROM:<reverse path><crlf> SOML<sp>FROM:<reverse path><crlf> SAML<sp>FROM:<reverst path><crlf> VRFY<sp><string<crlf> EXPN<sp> <string><crlf> HELP<sp><string><crlf> NOOP<crlf> QUIT<cflf> TURN<cflf>
Commands • HELP • 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
Commands • RSET • 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
Commands • HELP • 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
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
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