mail server fitri setyorini. content smtp pop3 how mail server works imap
TRANSCRIPT
Mail Server
Fitri Setyorini
Content
• SMTP
• POP3
• How mail server works
• IMAP
Electronic Mail: OverviewThree major components:
user agents, mail servers, SMTP User Agent– a.k.a. “mail reader”– composing, editing, reading mail
messages– e.g., Eudora, Outlook, elm,
Netscape MessengerMail Servers – mailbox contains incoming
messages for user– message queue of outgoing (to
be sent) mail messages– use SMTP protocol between
mail servers to send email messages
• client: sending mail server• “server”: receiving mail
server gmail?
user mailbox
outgoing message queue
mailserver
useragent
useragent
useragent
mailserver
useragent
useragent
mailserver
useragent
SMTP
SMTP
SMTP
SMTP
• uses TCP to reliably transfer email message from client to server, port 25
• direct transfer: sending server to receiving server
• three phases of transfer– handshaking (greeting)– transfer of messages– closure
• command/response interaction– commands: ASCII text– response: status code and phrase
• messages must be in 7-bit ASCII
Electronic Mail: a common scenario1) Alice uses UA to compose
message and “to” [email protected]
2) Alice’s UA sends message to her mail server; message placed in message queue
3) Client side of SMTP opens TCP connection with Bob’s mail server
4) SMTP client sends Alice’s message over the TCP connection
5) Bob’s mail server places the message in Bob’s mailbox
6) Bob invokes his user agent to read message
useragent
mailserver
mailserver user
agent
1
2 3 4 56
Electronic Mail: more on SMTP
• SMTP uses persistent connections• SMTP requires message (header & body) to be in 7-
bit ASCII• SMTP server uses CRLF.CRLF to determine end of
message
Electronic Mail: message format
SMTP: protocol for exchanging email messages
RFC 822: standard for text message format:
• header lines, e.g.,– To:– Date: – From:– Subject:– Message-ID:different from SMTP
commands!Read $MAIL
• body– the “message”, ASCII
characters only
header
body
blankline
Electronic Mail: MIME (multipurpose Intnet mail extensions)
• MIME: multimedia mail extension, RFC 2045, 2056
• additional lines in msg header declare MIME content type
From: [email protected] To: [email protected] Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg
base64 encoded data ..... ......................... ......base64 encoded data
multimedia datatype, subtype,
parameter declaration
method usedto encode data
MIME version
encoded data
Electronic Mail: MIME typesContent-Type: type/subtype;
parametersText• example subtypes: plain, html
Image• example subtypes: jpeg, gif
Audio• example 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
Electronic Mail: mail access protocols
• SMTP: delivery/storage to receiver’s server, “push”• Mail access protocol: retrieval from server, “pull”
– POP: Post Office Protocol [RFC 1939]• authorization (agent <-->server) and download
– IMAP: Internet Mail Access Protocol [RFC 1730]• more features (more complex)• manipulation of stored msgs on server• Originally designed more for connected operation
– HTTP: Hotmail , Yahoo! Mail, WebMail
useragent
sender’s mail server
useragent
SMTP SMTP accessprotocol
receiver’s mail server
POP (Post Office Protocol)
• POP is used to retrieve mail for a single user, typically the POP server has access from database email messages created by an SMTP server.
• POPv1 is launched on October 1984. It was published in RFC 918.
• POPv3 is the recently standard
• POP use port 110
How POP3 Works
• The server host starts the POP3 service by listening on TCP port 110.
• A client establishes a TCP connection with the server host.
• When the connection is established the server sends a greeting.
• The client and the server exchange commands and responses until the connection is closed or aborted.
• The server can respond with a positive status sending "+OK" to the client or with a negative status sending "-ERR" to the client (both in uppercase).
• Authorization stateIn this state, the client sends identification to the server. This is implemented in two ways (More information on authentication is described in RFC 1734):- Using USER and PASS commands- Using APOP command
• Transaction stateIn this state, the client can issue commands for listing, retrieving, and deleting. Please note that the deleting action is not taken in this state. The client must send the QUIT command and then the server goes to the update state.
• Update stateIn this state, the server updates the mailbox according to the commands received from the client in the transaction state and the TCP connection ends. If the connection is broken for any reason before the quit command is received from the client, the server does not enter the update state.Thus, the server will not update anything.
Difference between POP3 and IMAP
• POP3 works by reviewing the inbox on the mail server, and downloading the new messages to your computer. IMAP downloads the headers of the new messages on the server, then retrieves the message you want to read when you click on it.
• When using POP3, your mail is stored on your PC. When using IMAP, the mail is stored on the mail server. Unless you copy a message to a "Local Folder" the messages are never copied to your PC.
Konfigurasi Postfix pada main.cf
• myhostname = mail.jerapah.com• mydomain = jerapah.com• myorigin = $myhostname• inet_interfaces = all