Electronic mail on the internet: Electronic mail, or e-mail, is probably the most popular and widely used Internet function.. Some are most reliable, and some are faster Some standard pr
Trang 11 Introduction to Internet
1.1 Introduction
By the turn of the century, information, including access to the Internet, will be the basis for personal, economic, and political advancement The popular name for the Internet is the information superhighway Whether you want to find the latest financial news, browse through library catalogs, exchange information with colleagues, or join in a lively political debate, the Internet is the tool that will take you beyond telephones, faxes, and isolated computers to a burgeoning networked information frontier The Internet supplements the traditional tools you use to gather information, Data Graphics, News and correspond with other people Used skillfully, the Internet shrinks the world and brings information, expertise, and knowledge on nearly every subject imaginable straight to your computer
1 2 What is the Internet?
The Internet links are computer networks all over the world so that users can share resources and communicate with each other Some computers have direct access to all the facilities on the Internet such as the universities And other computers, eg privately-owned ones, have indirect links through a commercial service provider, who offers some
or all of the Internet facilities In order to be connected to Internet, you must go through service suppliers Many options are offered with monthly rates Depending on the option chosen, access time may vary
The Internet is what we call a metanetwork, that is, a network of networks that spans the globe It's impossible to give an exact count of the number of networks or users that comprise the Internet, but it is easily in the thousands and millions respectively The Internet employs a set of standardized protocols which allow for the sharing of resources among different kinds of computers that communicate with each other on the network These standards, sometimes referred to as the Internet Protocol Suite, are the rules that developers adhere to when creating new functions for the Internet The Internet is also what we call a distributed system; there is no central archives Technically, no one runs the Internet Rather, the Internet is made up of thousands of smaller networks The Internet thrives and develops as its many users find new ways to create, display and retrieve the information that constitutes the Internet
1.3 History & Development of the Internet
In its infancy, the Internet was originally conceived by the Department of Defense
as a way to protect government communications systems in the event of a military strike The original network, dubbed ARPANet (for the Advanced Research Projects Agency that developed it) evolved into a communications channel among contractors, military personnel, and university researchers who were contributing to ARPA projects
Trang 2The network employed a set of standard protocols to create an effective way for these people to communicate and share data with each other ARPAnet's popularity continued to spread among researchers and in the 1980 the National Science Foundation, whose NSFNet, linked several high speed computers, took charge of what had come to be known as the Internet
By the late 1980's, thousands of cooperating networks were participating in the Internet
In 1991, the U.S High Performance Computing Act established the NREN (National Research & Education Network) NREN's goal was to develop and maintain high-speed networks for research and education, and to investigate commercial uses for the Internet
The rest, as they say, is history in the making The Internet has been improved through the developments of such services as Gopher and the World Wide Web Even though the Internet is predominantly thought of as a research oriented network,
it continues to grow as an informational, creative, and commercial resource every day and all over the world
Birth of Internet - Key terms:
1960 most universities and Government agencies had individual
mainframe computers, which were not interconnected
1968 The national Physical Laboratory in Great Britain was the first to set up the test network
1969 Pentagon’s Department of ARPA came out with the first infant network with four nodes
Which was named as ARPANET
1971 there were fifteen nodes in ARPANET
1972 thirty seven nodes were added
1980 NSF net (National Science Foundation)
1.4 Features of internet
a Key Web Features
b Key Usenet Newsgroups Features
c Key Email Features
d Key Mailing List Features
a) Key Web Features
Ease Of Use
Universal Access
Search Capabilities
Trang 3The web leverages the key features of the Internet and makes them widely accessible
to the public Key features of the web in particular are its ease of use, universal accessibility, and ability to be quickly searched:
• Ease of use The web can be immediately used by anyone already familiar with a computer window The only special features are links, which are as natural and intuitive to use as pressing a button This ease of use enabled the rapid adoption of the web in the 1990's, and led to the establishment of the Internet around the world
• Universal access The open design of the web makes it easy to build web browsers for a wide range of devices Web browsers have been deployed on cell phones and personal organizers, and the web is now the standard interface for providing access to information
• Search capabilities The development of search sites greatly multiplied the power and usefulness of the web by providing the capability to effectively search the content of millions of web pages in seconds Search sites significantly enabled the web to realize Vannevar Bush's vision of an automated library system
b) Key Usenet Newsgroups Features
Usenet messages are organized in newsgroups and threads that are stored
in Usenet archives indefinitely for later retrieval by anyone that wishes to access
them, even years later, connecting people across generations
Mailing lists, IRC, and MUD's also provide group communications, although on a lessor scale
• Common space The Usenet is the second largest common public space in existence, next to the Internet itself Anyone can post anything they wish to any newsgroup, and anyone can read any message they wish from any newsgroup
Like most common spaces, the Usenet therefore reflects the best and worst
of human nature, from community newsgroups where people are focused on selflessly helping each other, to less worthwhile groups where the postings are filled with pointless and counterproductive information
Trang 4Like most common spaces, messages posted on the Usenet are public property
and can be freely copied and reused in other sources, although Usenet netiquette
mandates that credit should always be provided
c) Key Email Features
Email Is A Push Technology
Email Waits For You
Email Is One-To-Many
Email Is A Push Technology
Email is delivered to the recipient so they don't have to work to get it they just open their Inbox and there it is
Technologies are sometimes labeled push or pull as described below:
• Pull These technologies require the user to actively go and retrieve the information A library, the Web, and the Usenet are pull technologies, requiring active participation of a human being to retrieve the information
• Push These technologies deliver information to the user so all they have to do is receive it Radio, television, and email are push technologies
One of the reasons email has been such a big success is because it is a push technology The person that sends the email writes it, then POP3 and SMTP transmit it, and all the recipient has to do is open his email program and double-click on the email to read it
An advantage of push technologies is their ease of use they require a minimum of effort on the part of the recipient, which greatly supports adoption because they get used more often Partly because of this feature, the use of email has greatly outstripped all other Internet applications since its creation, even after the explosive development of the Web
Email Waits For You
Email is particularly convenient because it is asynchronous; it waits for you and fits into your schedule instead of demanding that you structure your activities to synchronize with those you communicate with
For example, an email recipient doesn't have to be available when you compose and send an email you can send it at the time that is most convenient to you Similarly, you don't have to be available or even connected to the Internet when someone else sends you email it waits on your server until you log in and download it when most convenient to
Trang 5Email provides the convenience that voice mail later provided for telephones except that voice mail is more ephemeral, cannot be conveniently edited, and is usually accompanied by a preference to talk to the other party in real time With email you know that the medium is inherently asynchronous, so you tend to write down all the information the addressee needs so they can respond when they are able.
• Sending You can send an email to more than one person at a time, for example to everyone in your family, or to a group of friends
• Receiving You can receive information that has been mailed to more than one person, for example an announcement sent to hundreds of people on a mailing list
The key advantage of this one-to-many communication is efficiency, since instead of sending emails individually; you can save large amounts of time by sending one email to several people at once
Similarly, when you receive an email from an Internet mailing list you are getting information that would probably be impractical to receive any other way, since most organizations don't have the time or resources to send out paper based notices individually to hundreds or even thousands of people
e Key Mailing List Features
One-to-many communication
Mailing lists enable powerful one-to-many communications
Because mailing lists are based on email, they share the key features of email
Mailing lists also build on that technology to create a new capability called many" functionality, enabling one person to communicate with many people at the same time This feature is a virtual Internet extension of the real-world communication power
"one-to-of a person speaking to a group, except that the members "one-to-of the audience may be located anywhere in the world
Trang 6The reverse is also true: mailing lists can give one person unique access to the
informed opinion of a diverse group of people on various subjects with little effort the
email arrives from the groups they have subscribed to, and they then read the ones they want
Like so many of the Internet technologies, mailing lists are important primarily because of their power to bring people around the world together in a single communication setting
• Dial Up Connection (telephone line)
• DSL (Digital Subscriber Line) (broadband)
– Asymmetric digital Subscriber line (ADSL)
– Symmetric digital Subscriber line (SDSL)
– Depending upon the speed
• High-data-rate DSL (HDSL)
• Very high DSL (VDSL)
• RF Link (radio frequency)
• ISDN (Integrated Services Digital Network)
• A Cable modem.( cable TV line)
1.6 What makes the internet work?
The unique thing about the Internet is that it allows many different computers
to connect and talk to each other This is possible because of a set of standards, known as protocols that govern the transmission of data over the network: TCP/IP (Transmission Control Protocol/Internet Protocol) Most people who use the Internet aren't so interested in details related to these protocols They do, however, want to know what they can do on the Internet and how to do it effectively
1.7 The Client/Server Model
The most popular Internet tools operate as client/server systems You're running a program called a Web client This piece of software displays documents for you and
Trang 7say, to set up a Telnet session, or to download a file your Web client will take care of this, too Your Web client connects (or "talks") to a Web server to ask for information on your behalf.
The Web server is a computer running another type of Web software which provides data, or "serves up" an information resource to your Web client
All of the basic Internet tools including Telnet, FTP, Gopher, and the World Wide Web are based upon the cooperation of a client and one or more servers In each case, you interact with the client program and it manages the details of how data is presented to you or the way in which you can look for resources In turn, the client interacts with one
or more servers where the information resides The server receives a request, processes it, and sends a result, without having to know the details of your computer system, because the client software on your computer system is handling those details The advantage of the client/server model lies in distributing the work so that each tool can focus or specialize on particular tasks: the server serves information to many users while the client software for each user handles the individual user's interface and other details of the requests and results
Characteristics of a client
• Initiates requests
• Waits for replies
• Receives replies
• Usually connects to a small number of servers at one time
• Typically interacts directly with end-users using a graphical user interface
Characteristics of a server
• Never initiates requests or activities
• Waits for and replies to requests from connected clients
• A server can remotely install/uninstall applications and transfer data to the intended clients
1.8 Electronic mail on the internet:
Electronic mail, or e-mail, is probably the most popular and widely used Internet function E-mail, email, or just mail, is a fast and efficient way to communicate with friends or colleagues You can communicate with one person at a time or thousands; you can receive and send files and other information You can even subscribe to electronic journals and newsletters You can send an e-mail message to a person in the same building or on the other side of the world
Trang 81.9 How does E-mail Work
E-mail is an asynchronous form of communication, meaning that the person whom you want to read your message doesn't have to be available at the precise moment you send your message This is a great convenience for both you and the recipient
On the other hand, the telephone, which is a synchronous communication medium, requires that both you and your listener be on the line at the same time in order for you to communicate (unless you leave a voice message) It will be impossible to discuss all the details of the many e-mail packages available to Internet users
Fortunately, however, most of these programs share basic functionality which allows you to:
Send and receive mail messages
save your messages in a file
print mail messages
reply to mail messages
attach a file to a mail message
• WWW was found in the year 1989 by Tim Berners-Lee of CERN (the European Organization for Nuclear Research)
• He founded the basic HTML to use on the web
• In October 1994 Time Berners-Lee founded the World Wide Web consortium organization for developing nonproprietary
WWW (World Wide Web)-Key TermsWeb pages, Web Site, Portal, Web Servers,Mail Server, File Server, News Server, DNS
Trang 92 HTML 4 ProtocolsProtocols Introduction
• A protocol is a program written as per mutually accepted standard that two
computers use to communicate with each other
• Computers use protocols to format consistently their message so that other
computer can understand them
The Protocols determines the following:
• The type of error checking to be used
• Data compression method, if any
• How they sending device will indicate that it has finished sending a message
• How they receiving device will indicate that it has received a message
• There are varieties of standard protocols from which programmers can choose
• Each has particular advantages and disadvantages,
• Ex: Some are simpler than others Some are most reliable, and some are faster
Some standard protocols
• Simple Mail Transfer protocol (SMTP)
• Post Office Protocol version3 (POP3)
• Transmission Control Protocol/Internet Protocol (TCP/IP)
• Hyper Text Transfer Protocol (HTTP)
• File Transfer Protocol (FTP)
• Internet Mail Access Protocol (IMAP)
• Multipurpose Internet Mail Extensions (MIME)
• Network News Transfer Protocol (NNTP)
2.1 Hyper Text Transfer Protocol (HTTP).
HTTP is the network protocol of the Web It is both simple and powerful Knowing HTTP enables you to write Web browsers, Web servers, automatic page downloader’s, link-checkers, and other useful tools
2.1.1 What is HTTP
HTTP stands for Hypertext Transfer Protocol It's the network protocol used to deliver
virtually all files and other data (collectively called resources) on the World Wide Web,
whether they're HTML files, image files, query results, or anything else Usually, HTTP takes place through TCP/IP sockets (and this tutorial ignores other possibilities)
A browser is an HTTP client because it sends requests to an HTTP server (Web server),
which then sends responses back to the client The standard (and default) port for HTTP servers to listen on is 80, though they can use any port
Trang 102.1.2 What are "Resources"
HTTP is used to transmit resources, not just files A resource is some chunk of
information that can be identified by a URL (it's the R in URL) The most common kind
of resource is a file, but a resource may also be a dynamically-generated query result, the output of a CGI script, a document that is available in several languages, or something else
While learning HTTP, it may help to think of a resource as similar to a file, but more general As a practical matter, almost all HTTP resources are currently either files or server-side script output
2.1.3 Structure of HTTP Transactions
Like most network protocols, HTTP uses the client-server model: An HTTP client opens
a connection and sends a request message to an HTTP server; the server then returns a response message, usually containing the resource that was requested After delivering the response, the server closes the connection (making HTTP a stateless protocol, i.e not
maintaining any connection information between transactions)
The format of the request and response messages is similar, and English-oriented Both kinds of messages consist of:
• an initial line,
• zero or more header lines,
• a blank line (i.e a CRLF by itself), and
• an optional message body (e.g a file, or query data, or query output)
Put another way, the format of an HTTP message is:
<initial line, different for request vs response>
Header1: value1
Header2: value2
Header3: value3
<optional message body goes here, like file contents or query data;
it can be many lines long, or even binary data $&*%@!^$@>
Initial lines and headers should end in CRLF, though you should gracefully handle lines ending in just LF (More exactly, CR and LF here mean ASCII values 13 and 10, even though some platforms may use different characters.)
Trang 11HTTP-Key Terms
• HTTP is the underlying protocol used by the WWW
• HTTP is stateless protocol (http is “stateless”
• server maintains no information about past client requests)
– Each visit as if the only visit so far
– Previous visits are not remembered by the server.
• HTTP Defines how messages are formatted and transmitted, and what action web servers and browsers should take in response to various commands
• HTTP is called a stateless protocol because each command is executed independently, without any knowledge of the commands that came before it
2.1.4 HTTP Versions: Past and Present
HTTP has evolved into multiple, mostly backwards-compatible protocol versions RFC
2145 describes the use of HTTP version numbers The client tells in the beginning of the request the version it uses, and the server uses the same or earlier version in the response
2.1.4.1 HTTP/0.9 (1991)
Deprecated Supports only one command, GET, which does not specify the HTTP version Does not support headers Since this version does not support POST, the information a client can pass to the server is limited by the URL length
Trang 12Force PEP was originally intended to become a distinguishing feature of HTTP/1.2 In later PEP working drafts, however, the reference to HTTP/1.2 was removed The
experimental RFC 2774, HTTP Extension Framework, largely subsumed PEP It was
published in February 2000
The major changes between HTTP/1.0 and HTTP/1.1 include the way HTTP handles caching; how it optimizes bandwidth and network connections usage, manages error notifications; how it transmits messages over the network; how internet addresses are conserved; and how it maintains security and integrity
2.1.5 HTTP Methods
HTTP defines eight methods (sometimes referred to as "verbs") indicating the desired
action to be performed on the identified resource.
HEAD
Asks for the response identical to the one that would correspond to a GET request, but without the response body This is useful for retrieving meta-information written in response headers, without having to transport the entire content
GET
Requests a representation of the specified resource By far the most common method used on the Web today Should not be used for operations that cause side-effects (using it for actions in web applications is a common misuse) See safe methods below
POST
Submits data to be processed (e.g from an HTML form) to the identified resource The data is included in the body of the request This may result in the creation of a new resource or the updates of existing resources or both
Returns the HTTP methods that the server supports for specified URL This can
be used to check the functionality of a web server by requesting '*' instead of a specific resource
Trang 13CONNECT
Converts the request connection to a transparent TCP/IP tunnel, usually to facilitate SSL-encrypted communication (HTTPS) through an unencrypted HTTP proxy
HTTP servers are required to implement at least the GET and HEAD methods and, whenever possible, also the OPTIONS method
2.1.6 Safe & Unsafe Methods
Some methods (e.g HEAD, GET, OPTIONS, and TRACE) are defined as safe,
which means they are intended only for information retrieval and should not change the state of the server (in other words, they should not have side effects) Repetition of the same GET request should therefore be harmless
Unsafe methods (such as POST, PUT and DELETE) should draw special attention, typically as a dialog box requesting confirmation of the action This is because repeated requests can cause side effects, such as unwanted duplication of a transaction
2.2 Simple Mail Transfer protocol (SMTP).
2.2.1 Introduction
The objective of the Simple Mail Transfer Protocol (SMTP) is to transfer mail reliably and efficiently
SMTP is independent of the particular transmission subsystem and requires only
a reliable ordered data stream channel While this document specifically discusses transport over TCP, other transports are possible
An important feature of SMTP is its capability to transport mail across networks, usually referred to as "SMTP mail relaying" A network consists of the mutually-TCP-accessible hosts on the public Internet, the mutually-TCP-accessible hosts
on a firewall-isolated TCP/IP Intranet, or hosts in some other LAN or WAN environment utilizing a non-TCP transport-level protocol
2.2.2 Structure of SMTP
The SMTP design is based on the following model of communication: as the result of a user mail request, the sender-SMTP establishes a two-way transmission channel to a receiver-SMTP The receiver-SMTP may be either the ultimate destination
or an intermediate SMTP commands are generated by the sender-SMTP and sent to the receiver-SMTP SMTP replies are sent from the receiver-SMTP to the sender-SMTP in response to the commands
Once the transmission channel is established, the SMTP-sender sends a MAIL command indicating the sender of the mail If the SMTP-receiver can accept mail it
Trang 14responds with an OK reply The SMTP-sender then sends a RCPT command identifying
a recipient of the mail If the SMTP-receiver can accept mail for that recipient it responds with an OK reply; if not, it responds with a reply rejecting that recipient (but not the whole mail transaction) The SMTP-sender and SMTP-receiver may negotiate several recipients When the recipients have been negotiated the SMTP-sender sends the mail data, terminating with a special sequence If the SMTP-receiver successfully processes the mail data it responds with an OK reply The dialog is purposely lock-step, one-at-a-time
2.2.3 History of SMTP
The Mail Transfer Protocol (MTP) was first defined in RFC 772 in September
1980, and then updated in RFC 780 in May 1981 MTP describes a set of commands and procedures by which two devices can connect using TCP to exchange e-mail messages Its operation is described largely using elements borrowed from two early TCP/IP application protocols that were already in use at that time: Telnet and FTP The commands of MTP are in fact based directly on those of FTP
There wasn't anything inherently wrong with basing e-mail delivery on something like FTP, but defining it this way made MTP somewhat of a “hack” It was also restricted
to the capabilities defined by FTP, a general file transfer protocol, so it was not possible
to include features in the protocol that were specific to sending and receiving mail Due
to the importance of mail, a specific protocol designed for the purpose of delivering mail was warranted This protocol was first defined in RFC 788, published in November
e-1981: the Simple Mail Transfer Protocol (SMTP)
The name suggests that SMTP is “simpler” than the “non-simple” MTP that it replaced Whether this is true or not is somewhat a matter of opinion; I do note that RFC
788 is 61 pages long, while the earlier RFC 780 was only 43 pages What SMTP
definitely has over MTP is elegance; the protocol is designed specifically for the
transport of electronic mail While it retains certain similarities to FTP, it is an
“independent” protocol running over TCP So, from a conceptual standpoint, it can be considered simpler than MTP In terms of mechanics, the process SMTP uses to transfer
an e-mail message is indeed rather simple, especially compared to some other protocols
Trang 15RFC 788 described the operation of SMTP carrying e-mail messages corresponding to the ARPAnet text message standard as described in RFC 733 Development of both e-mail messages and the SMTP protocol continued, of course In August 1982, a milestone in TCP/IP e-mail was achieved when RFCs 821 and 822 were published RFC 821 revised SMTP, and became the defining standard for the protocol for the next two decades RFC 822, its companion standard, became the standard for TCP/IP electronic mail messages carried by SMTP
HELO Hello The domain name of
the sender
The conventional instruction sent by an SMTP sender to an SMTP receiver to initiate the SMTP session
MAIL Initiate Mail Transaction
Must include a
“FROM:” parameter specifying the originator of the message, and may contain other parameters as well
Begins a mail transaction from the sender to the receiver
Trang 16RCPT Recipient
Must include a “TO:”
parameter specifying the recipient mailbox, and may also
incorporate other optional parameters
Specifies one recipient of the e-mail message being conveyed in the current transaction
DATA
Mail Message
Tells the SMTP receiver that the SMTP sender is ready to transmit the e-mail message The receiver normally replies with an intermediate “go ahead”
message, and the sender then transmits the message one line at a time,
indicating the end of the message by a single period on a line by itself
Aborts a mail transaction in progress This may be used if an error is received
upon issuing a MAIL or RCPT
command, if the SMTP sender cannot continue the transfer as a result
VRFY Verify E-mail address of mailbox to be
verified
Asks the SMTP receiver to verify the validity of a mailbox
EXPN Expand E-mail address of mailing list.
Requests that the SMTP server confirm that the address specifies a mailing list, and return a list of the addresses on the list
name
Requests help information: general help
if no parameter is supplied, otherwise information specific to the command code supplied
The commands in the preceding table are the ones that are most commonly used
in SMTP today In addition to those, there are also certain commands that were originally defined in RFC 821 but have since become obsolete
Trang 17SEND, SAML (“send and mail”) and SOML (“send or mail”): RFC 821 defined a
distinct mechanism for delivering mail directly to a user's terminal as opposed to a mailbox, optionally in combination with conventional e-mail delivery These were rarely implemented and obsoleted in RFC 2821
TURN: Reverses the role of the SMTP sender and receiver as described in the
SMTP special features topic This had a number of implementation and security issues and was removed from the standard in RFC 2821
Key Terms
• SMTP is used for sending e-mail messages
between servers
• Simple Mail Transport Protocol or SMTP is the
universal standard for moving mail over the Net
• Most e-mail systems that send mail over the internet
use SMTP to send messages from one server to another
• SMTP generally used to send messages from a mail
client to a mail server
2.3 Post Office Protocol version3 (POP3).
POP3 has made earlier versions of the protocol, informally called POP1 and
POP2, obsolete In contemporary usage, the less precise term POP almost always means POP3 in the context of e-mail protocols
2.3.1 Introduction
Post Office Protocol 3 (POP3) is a standard interface between an e-mail client program and the mail server, defined by IETF RFC 1939 The 3 at the end of the POP denotes that this is the third version of the mailbox access protocol POP3 and IMAP4 are the two common mailbox access protocols used for Internet e-mail POP3 provides a message store that holds incoming e-mail Users may log on and download their messages Most POP3 servers allow the downloading just the headers, the headers and a specified number of lines from the body of the message, or the entire message The mail client may automatically delete downloaded messages or offer the use the choise of leaving any or all of the messages on the server
2.3.2 POP3 Commands
Trang 18USER user Username Provides username to the POP3 server Must be followed by a PASS command.
PASS pass Password Provides a password to the POP3 server Must follw a USER
DELE dele MessageNumber Marks the specified message for deletion
RSET rset Resets any messages which have been marked as read or deleted to the standard unread state.NOOP noop Returns a simple acknowledgement, without performing any
function
APOP apop Username EncryptedKey
Allows for a secure method of POP3 authentication, in which
a cleartext password does not have to be sent Instead, the client creates an MD5 encrypted string from the password, process id, and timestamp, and sends it to the POP3 server
2.3.3 Why POP 4
POP 3 is based on the principal of providing simple functionality on the server and putting all of the intelligence on the client This works well enough because most of the world is using POP 3 and its working just fine
POP 4 adds a few functions that allow the server to perform some more useful functionality while adding very little complexity to the server The design goal was to create a server protocol based on POP3 that had the minimum functionality required to operate a useful web-based mail client It was not intended to solve all of the
Trang 19POP 4 is a superset of POP 3 and was styled around the interface that POP 3 currently supports To this end, the protocol is every bit as simple as POP 3, very little was added in terms of grammar to support the new commands So for example the usual dot-terminated-list is utilized as well as four letter command names Please note that below is the complete list of additions for the POP 4 protocol Some of them are mandatory, some are optional Please read the POP 4 spec in the link above for more details about each command
Key Terms
• POP is a protocol used to retrieve e-mail from a
mail server
• Provides centralized storage for e-mail messages
• POP does not allow users to store mail on the
server after they download it
• There are two versions of protocol
– POP2 requires SMTP
– POP3 Can be used with or without SMTP
2.4 Multipurpose Internet Mail Extensions (MIME).
In 1992, a new standard was defined by an Internet Engineering Task Force Working
2.4.1 Introduction
MIME is a specification for enhancing the capabilities of standard Internet electronic mail It offers a simple standardized way to represent and encode a wide variety of media types for transmission via Internet mail
When using the MIME standard, messages can contain the following types:
• Text messages in US-ASCII
• Character sets other than US-ASCII
• Multi-media: Image, Audio, and Video messages
• Multiple objects in a single message
Trang 202.4.2 What is MIME
On the Internet, data is sent as 8 bit bytes The receiving software collects these bytes and assembles them in the proper order Now the question becomes, "What do these bytes represent?" Are they text? Are they a picture? Are they a sound? How is it possible to know what they mean? Suppose, in addition to the bytes that contain whatever
it is, an additional few bytes are sent along saying what the data is If this is done, the recieving software or person knows what is in the bunch of bytes that make up the message This is what MIME does It tells what is in a message so that the message contents can be used in an appropriate way
2.4.3 History
The first steps to extend emails were defined 1985 in RFC 934 This document proposed a standard for message encapsulation when replying and forwarding messages After few years, in 1988 a content-type header for email was proposed in RFC 1049, which supported message contents like postscript and troff Two years later RFC 1154 proposed encoding header field to be used in email that permitted multi-structural messages This was highly experimental document at that time
In June 1992 were introduced RFCs 1341 and 1342 that can be considered the first version of MIME that we are today aware of They introduced extensions for images, audio and general application, encoding schemes that are used today and representation
of non-ascii data These documents were refined and expanded two years later in RFCs
1521, 1522 and 1523 The last RFC talked only about enriched text in MIME Two years ago, December 1996 MIME related RFCs were reworked once again and this time into a group of five RFCs 2045 through 2049 After these documents more extensions to MIME such as security has been proposed, but they have remained in separate documents
2.4.4 MIME message structure
MIME was designed to be in compliance with RFC 822 New introduces message headers are themselves consistent with message header syntax defined in RFC 822 In fact, RFC 822 specifically states that unrecognized message headers should be ignored Therefore Mail User Agent should be able to receive MIME messages, although some of data is not understood
MIME allows creating composite messages with one or more subparts, each of which can contain subparts There is no limit to number of nested message parts in message Each subpart is separated with a MIME boundary and has headers similar but not identical to the mail message headers MIME defines a number of new header fields in compliance with RFC822 header syntax They are used to describe the content of MIME message MIME specific header can occur in at least two contexts:
1 top level message headers
Trang 212.4.5 What are some common MIME types
text/plain as in the usual mail or news message
text/html HTML text as on the World Wide Web
image/jpeg a common image format
image/gif another common image format
application/octet-stream unknown type, any kind of data as bytes
audio/midi midi music format for synthesizers
audio/x-midi an alternate for the above
application/ps indicates PostScript document
Key Termes
• MIME protocol allows for the transmission of the
multimedia electronic mail
• MIME message generally consists of header fields
followed by data
• The header fields specify the MIME versions
• MIME is a protocol that allows you to send files as
attachments to e-mail easily
• Permits nontextual data to be sent in email
– Graphics image– Voice or video clip
2.5 Internet Mail Access Protocol (IMAP).
Short for Internet Message Access Protocol, a protocol for retrieving e-mail messages
The latest version, IMAP4, is similar to POP3 but supports some additional features For
example, with IMAP4, you can search through your e-mail messages for keywords while the messages are still on mail server You can then choose which messages to download
to your machine
2.5.1 History
IMAP was designed by Mark Crispin in 1986 as a remote mailbox protocol, in contrast to the widely used POP, a protocol for retrieving the contents of a mailbox IMAP was developed at Stanford University in 1986
Original IMAP
The original Interim Mail Access Protocol was implemented as a Xerox Lisp machine client and a TOPS-20 server
Trang 22No copies of the original interim protocol or its software exist; all known installations of the original protocol were updated to IMAP2 Although some of its commands and responses were similar to IMAP2, the interim protocol lacked command/response tagging and thus its syntax was incompatible with all other versions
of IMAP
IMAP2
The interim protocol was quickly replaced by the Interactive Mail Access Protocol (IMAP2), defined in RFC 1064 and later updated by RFC 1176 IMAP2 introduced command/response tagging and was the first publicly distributed version
IMAP2bis
With the advent of MIME, IMAP2 was extended to support MIME body
structures and add mailbox management functionality (create, delete, rename, message upload) that was absent in IMAP2 This experimental revision was called IMAP2bis; its specification was never published in non-draft form Early versions of Pine were widely distributed with IMAP2bis support (Pine 4.00 and later supports IMAP4rev1)
IMAP4
An IMAP Working Group formed in the IETF in the early 1990s and took over responsibility for the IMAP2bis design The IMAP WG decided to rename IMAP2bis to IMAP4 to avoid confusion with a competing IMAP3 proposal from another group that never got off the ground The expansion of the IMAP acronym also changed to the Internet Message Access Protocol
Some design flaws in the original IMAP4 (defined by RFC 1730) that came out in implementation experience led to its revision and replacement by IMAP4rev1 two years later There were very few IMAP4 client or server implementations due to its short lifetime
IMAP4rev1
The current version of IMAP since 1996, IMAP version 4 revision 1
(IMAP4rev1), is defined by RFC 3501 which revised the earlier RFC 2060.
IMAP4rev1 is upwards compatible with IMAP2 and IMAP2bis; and is largely upwards-compatible with IMAP4 However, the older versions are either extinct or nearly so
Unlike many older Internet protocols, IMAP4 natively supports encrypted login mechanisms Plain-text transmission of passwords in IMAP4 is also possible Because the encryption mechanism to be used must be agreed between the server and client, plain-text passwords are used in some combinations of clients and servers (typically Microsoft Windows clients and non-Windows servers) It is also possible to encrypt IMAP4 traffic
Trang 23using SSL, either by tunneling IMAP4 communications over SSL on port 993, or by
issuing STARTTLS within an established IMAP4 session (see RFC 2595).
IMAP4 works over a TCP/IP connection using network port 143
2.5.2 IMAP advantages
The functional areas where POP is weak, with respect to online/disconnected operation, are strengths for IMAP, since online access was its original design center Specific advantages of IMAP over POP (for online/disconnected use) include:
Remote Folder Manipulation:
Multiple folder support
Online performance optimization
In addition, IMAP has provision for negotiated extensions, and therefore its capabilities can grow incrementally
Support for simultaneous update and update discovery in shared folders
2.5.3 Disadvantages of IMAP
IMAP has two disadvantages when compared to POP:
The protocol is more complex, and requires more effort to implement
There is currently less IMAP software available than POP software
While IMAP remedies many of the shortcomings of POP, this inherently introduces additional complexity Much of this complexity (e.g., multiple clients accessing the same mailbox at the same time) is compensated for by server-side workarounds such as maildir or database backends
Unless the mail store and searching algorithms on the server are carefully implemented, a client can potentially consume large amounts of server resources when searching massive mailboxes
IMAP4 clients need to explicitly request new email message content potentially causing additional delays on slow connections such as those commonly used by mobile devices A private proposal, push IMAP, would extend IMAP to implement push e-mail
by sending the entire message instead of just a notification However, push IMAP has not been generally accepted and current IETF work has addressed the problem in other ways (see the Lemonade Profile for more information)
Unlike some proprietary protocols which combine sending and retrieval operations, sending a message and saving a copy in a server-side folder with a base-level IMAP client requires transmitting the message content twice, once to SMTP for delivery and a second time to IMAP to store in a sent mail folder This is remedied by a set of extensions defined by the IETF LEMONADE Working Group for mobile devices:
Trang 24URLAUTH (RFC 4467) and CATENATE (RFC 4469) in IMAP and BURL (RFC
4468) in SMTP-SUBMISSION POP3 servers don't support server-side folders so clients
have no choice but to store sent items on the client Many IMAP clients can be configured to store sent mail in a client-side folder In addition to the LEMONADE
"trio", Courier Mail Server offers a non-standard method of sending using IMAP by copying an outgoing message to a dedicated outbox folder
• The mail always stays on the server
3 Introduction to java script
JavaScript is a programming language that can be included on web pages to make them more interactive You can use it to check or modify the contents of forms, change
Trang 25images, open new windows and write dynamic page content You can even use it with CSS to make DHTML (Dynamic Hyper Text Markup Language).
This allows you to make parts of your web pages appear or disappear or move around
on the page Java Scripts only execute on the page(s) that are on your browser window at any set time When the user stops viewing that page, any scripts that were running on it are immediately stopped The only exception is a cookie, which can be used by many pages to pass information between them, even after the pages have been closed
Before we go any further, let me say; JavaScript has nothing to do with Java If we are honest, JavaScript, originally nicknamed LiveWire and then LiveScript when it was created by Netscape, should in fact be called ECMAscript as it was renamed when Netscape passed it to the ECMA for standardization
JavaScript is a client side, interpreted, object oriented, high level scripting language, while Java is a client side, compiled, object oriented high level language
A scripting language developed by Netscape to enable Web authors to design interactive sites Although it shares many of the features and structures of the full Java language, it was developed independently Javascript can interact with HTML source code, enabling Web authors to spice up their sites with dynamic content JavaScript is endorsed by a number of software companies and is an open language that anyone can use without purchasing a license It is supported by recent browsers from Netscape and
Microsoft, though Internet Explorer supports only a subset, which Microsoft calls Jscript.
3.1 What is JavaScript
JavaScript was designed to add interactivity to HTML pages
JavaScript is a scripting language
A scripting language is a lightweight programming language
JavaScript is usually embedded directly into HTML pages
JavaScript is an interpreted language (means that scripts execute without preliminary compilation)
Everyone can use JavaScript without purchasing a license
3.2 What can a JavaScript Do
JavaScript gives HTML designers a programming tool - HTML authors
are normally not programmers, but JavaScript is a scripting language with a very simple syntax! Almost anyone can put small "snippets" of code into their HTML pages
JavaScript can put dynamic text into an HTML page - A JavaScript
statement like this: document write("<h1>" + name + "</h1>") can write a variable text into an HTML page
JavaScript can react to events - A JavaScript can be set to execute when
something happens, like when a page has finished loading or when a user clicks on an HTML element
Trang 26 JavaScript can read and write HTML elements - A JavaScript can read
and change the content of an HTML element
JavaScript can be used to validate data - A JavaScript can be used to
validate form data before it is submitted to a server This saves the server from extra processing
JavaScript can be used to detect the visitor's browser - A JavaScript can
be used to detect the visitor's browser, and - depending on the browser - load another page specifically designed for that browser
JavaScript can be used to create cookies - A JavaScript can be used to
store and retrieve information on the visitor's computer
3.3 HTML – Java Script
3.3.1 How to Put a JavaScript Into an HTML Page
To insert a JavaScript into an HTML page, we use the <script> tag Inside the
<script> tag we use the type attribute to define the scripting language
So, the <script type="text/javascript"> and </script> tells where the JavaScript starts and ends:
3.3.2 Where to Put the JavaScript
JavaScript in a page will be executed immediately while the page loads into the browser This is not always what we want Sometimes we want to execute a script when a page loads, other times when a user triggers an event
Trang 27Scripts in the head section: Scripts to be executed when they are called, or when
an event is triggered, go in the head section When you place a script in the head section, you will ensure that the script is loaded before anyone uses it
3.3.3 Where did it come from
Originally called Live Script at Netscape
– started out to be a server side scripting language for providing database connectivity and dynamic HTML generation on Netscape Web Servers– Netscape decided it would be a good thing for their browsers and servers
to speak the same language so it got included in Navigator– Netscape in alliance w/Sun jointly announced the language and its new name Java Script
– Because of rapid acceptance by the web community Microsoft forced to include in IE Browser
3.3.4 What can it be used for
Some pretty amazing things…
– Text animation
– graphic animation
– simple browser based application
– HTML forms submission
– client-side forms data validation (relieving the server of this task)
– web site navigation
3.4 Object based scripting
Objects refer to windows, documents, images, tables, forms, buttons or links, etc.Objects should be named Objects have properties that act as modifiers
3.4.1 Objects
• window - the current browser window
• window.history - the Netscape history list
• window.document - the html document currently in the browser client area
• window.location - the browser location field
• window.toolbar - the browser toolbar
• window.document.link - an array containing all of the links in the document
• window.document.anchor - an array of all the anchor points in the document
• Window.document.layer - a named document layer
• window.document.applet - a named java applet area
• window.document.image- a named image tag
• window.document.area - a named area
• window.document.form - a named form or the default form,ect
A few examples
• window.location = “http://www.yahoo.com”
– will take you to the specified URL (like a goto)
Trang 28• window.history.back()
– back() is a method on history
– will be like clicking the back button in Nav 3
– in Nav 4 will take you back to prev window
alertblurcloseconfirmfocusopenpromptclearTimeoutsetTimeout
onLoadonUnloadonBluronFocus
Frame defaultStatus
framesopenerparentscrollselfstatustopwindow
alertblurcloseconfirmfocusopenpromptclearTimeoutsetTimeout
none (The onLoad and onUnload event handlers belong to the Window object)
Location hash
hosthostnamehrefpathnameporprotocolsearch
reloadreplace
None
History length
forwardgo
Navigator appCodeName
appNameappVersionmimeTypes
Trang 29userAgentdocument alinkColor
anchorsappletsareabgColorcookiefgColorformsimageslastModifiedlinkColorlinkslocationreferrertitlevlinkColor
clearcloseopenwritewriteln
none (the onLoad and onUnload event handlers belong to the Window object
image
bordercompleteheighthspacelowsrcnamesrcvspacewidth
elementsencodingFileUploadmethodnametarget
submitreset
onSubmitonReset
text defaultValue
nametypevalue
focusblurselect
onBluronChargeonFocusonSelect
3.4.3 Object Model
It is very important to understand the object model
each object has its own properties, some of which are read only some of which you can set directly by assignment (as location)
each object also has a set of behaviors called methods
Trang 303.4.4 Object Syntax
The following objects are also available in JavaScript:
B anchor (anchors array)
B form (forms array)
B frame (frames array)
anchor ( anchors array)
A piece of text that can be the target of a hypertext link
A pushbutton on an HTML form
Syntax
Trang 31To define a button:
<INPUT TYPE="button" NAME="buttonName" VALUE="buttonText"
[onClick="handlerText"]>
NAME="buttonName" specifies the name of the button object You can access
this value using the name property
VALUE="buttonText" specifies the label to display on the button face You can
access this value using the value property
NAME="checkboxName" specifies the name of the checkbox object You can
access this value using the name property
VALUE="checkboxValue" specifies a value that is returned to the server when the
checkbox is selected and the form is submitted This defaults to "on" You can access this value using the value property
CHECKED specifies that the checkbox is displayed as checked You can access
this value using the defaultChecked property
textToDisplay specifies the label to display beside the checkbox.
Date Object
Lets you work with dates and times
Syntax
Trang 32To create a Date object:
1 dateObjectName = new Date()
2 dateObjectName = new Date("month day, year hours:minutes:seconds")
3 dateObjectName = new Date(year, month, day)
4 dateObjectName = new Date(year, month, day, hours, minutes,
seconds)
dateObjectName is either the name of a new object or a property of an existing object month, day, year, hours, minutes, and seconds are string values for form 2 of the syntax
For forms 3 and 4, they are integer values
To use Date methods:
dateObjectName.methodName(parameters)
dateObjectName is either the name of an existing Date object or a property of an existing
object
methodName is one of the methods listed below
Exceptions: The Date object's parse and UTC methods are static methods that you use as follows:
Date.UTC(parameters)
Date.parse(parameters)
Methods:
Trang 33<BODY BACKGROUND="backgroundImage" BGCOLOR="backgroundColor"
TEXT="foregroundColor"LINK="unfollowedLinkColor"
ALINK="activatedLinkColor"VLINK="followedLinkColor"
[onLoad="handlerText"][onUnload="handlerText"]>
</BODY>
BACKGROUND specifies an image that fills the background of the document
BGCOLOR, TEXT, LINK, ALINK, and VLINK are color specifications expressed
as a hexadecimal RGB triplet (in the format "rrggbb" or "#rrggbb") or as one of the string literals listed in Color Values
formName is either the name of a form or an element in the forms array
index is an integer representing an object on a form
form ( forms array)
Lets users input text and make choices from form objects such as checkboxes, radio buttons, and selection lists You can also use a form to post data to a server
Syntax
To define a form, use standard HTML syntax with the addition of the onSubmit event handler:
<FORM NAME="formName" TARGET="windowName" ACTION="serverURL"
METHOD=GET | POST ENCTYPE="encodingType" [onSubmit="handlerText"]>
</FORM>
NAME="formName" specifies the name of the form object
TARGET="windowName" specifies the window that form responses go to When
you submit a form with a TARGET attribute, server responses are displayed in the
specified window instead of the window that contains the form windowName can be an
existing window; it can be a frame name specified in a <FRAMESET> tag; or it can be one of the literal frame names _top, _parent, _self, or _blank; it cannot be a JavaScript
expression (for example, it cannot be parent.frameName or windowName.frameName)
Some values for this attribute may require specific values for other attributes
Trang 34ACTION="serverURL" specifies the URL of the server to which form field input
information is sent This attribute can specify a CGI or LiveWire application on the server; it can also be a mailto: URL if the form is to be mailed
METHOD=GET | POST specifies how information is sent to the server specified
by ACTION GET (the default) appends the input information to the URL which on most receiving systems becomes the value of the environment variable QUERY_STRING POST sends the input information in a data body which is available on stdin with the data length set in the environment variable CONTENT_LENGTH Some values for this
attribute may require specific values for other attributes
ENCTYPE="encodingType" specifies the MIME encoding of the data sent:
"application/x-www-form-urlencoded" (the default) or "multipart/form-data" Some values for this attribute may require specific values for other attributes
frame ( frames array)
A window that can display multiple, independently scrollable frames on a single screen, each with its own distinct URL Frames can point to different URLs and be targeted by other URLs, all within the same screen A series of frames makes up a page
Syntax
To define a frame object, use standard HTML syntax The onLoad and onUnload event handlers are specified in the <FRAMESET> tag but are actually event handlers for the window object:
ROWS="rowHeightList" is a comma-separated list of values specifying the
row-height of the frame An optional suffix defines the units Default units are pixels
COLS="columnWidthList" is a comma-separated list of values specifying the
column-width of the frame An optional suffix defines the units Default units are pixels
<FRAME> defines a frame
SRC="locationOrURL" specifies the URL of the document to be displayed in the
frame The URL cannot include an anchor name; for example <FRAME SRC="doc2.html#colors" NAME="frame2"> is invalid
NAME="frameName" specifies a name to be used as a target of hyperlink jumps.
Trang 35 hidden object
A text object that is suppressed from form display on an HTML form A hidden object is used for passing name/value pairs when a form submits
Syntax
To define a hidden object:
<INPUT TYPE="hidden" NAME="hiddenName" [VALUE="textValue"]>
NAME="hiddenName" specifies the name of the hidden object You can access
this value using the name property
VALUE="textValue" specifies the initial value of the hidden object.
propertyName is one of the properties
methodName is one of the methods.
o link object ( links array)
A piece of text or an image identified as a hypertext link When the user clicks the link text, the link hypertext reference is loaded into its target window
Syntax
To define a link, use standard HTML syntax with the addition of the onClick and
onMouseOver event handlers:
Trang 36<A HREF=locationOrURL [NAME="anchorName"]
HREF=locationOrURL identifies a destination anchor or URL
NAME="anchorName" specifies a tag that becomes an available hypertext target
within the current document If this attribute is present, the link object is also an anchor object
TARGET="windowName" specifies the window that the link is loaded into windowName can be an existing window; it can be a frame name specified in a
<FRAMESET> tag; or it can be one of the literal frame names _top, _parent, _self, or
_blank; it cannot be a JavaScript expression (for example, it cannot be parent.frameName
windowReference is a variable windowVar from a window definition or one of
the synonyms top or parent
propertyName is one of the properties listed below.
A built-in object that has properties and methods for mathematical constants and
functions For example, the Math object's PI property has the value of pi
Syntax
To use a Math object:
Trang 371 Math.propertyName
2 Math.methodName(parameters)
propertyName is one of the properties.
methodName is one of the methods.
NAME="passwordName"
[VALUE="textValue"]
SIZE=integer>
NAME="passwordName" specifies the name of the password object You can
access this value using the name property
VALUE="textValue" specifies the initial value of the password object You can
access this value using the defaultValue property
SIZE=integer specifies the number of characters the password object can
accommodate without scrolling
radio object
A set of radio buttons on an HTML form A set of radio buttons lets the user choose one item from a list
Trang 38To define a set of radio buttons, use standard HTML syntax with the addition of the onClick event handler:
<INPUT TYPE="radio" NAME="radioName" VALUE="buttonValue"
[CHECKED] [onClick="handlerText"]> textToDisplay
NAME="radioName" specifies the name of the radio object All radio buttons in a
group have the same NAME attribute You can access this value using the name property
VALUE="buttonValue" specifies a value that is returned to the server when the
radio button is selected and the form is submitted This defaults to "on" You can access this value using the value property
CHECKED specifies that the radio button is selected You can access this value
using the defaultChecked property
textToDisplay specifies the label to display beside the radio button.
NAME="resetName" specifies the name of the reset object You can access this
value using the name property
VALUE="buttonText" specifies the text to display on the button face You can
access this value using the value property
o select object ( options array)
A selection list or scrolling list on an HTML form A selection list lets the user choose one item from a list A scrolling list lets the user choose one or more items from a list
Trang 39To define a select object, use standard HTML syntax with the addition of the onBlur, onChange, and onFocus event handlers:
<SELECT NAME="selectName" [SIZE="integer"] [MULTIPLE]
NAME="selectName" specifies the name of the select object You can access this
value using the name property
SIZE="integer" specifies the number of options visible when the form is
displayed
MULTIPLE specifies that the select object is a scrolling list (not a selection list) OPTION specifies a selection element in the list You can access the options using
the options array
VALUE="optionValue" specifies a value that is returned to the server when the
option is selected and the form is submitted You can access this value using the value property
SELECTED specifies that the option is selected by default You can access this
value using the defaultSelected property
textToDisplay specifies the text to display in the list You can access this value
using the text property
Trang 40stringName is the name of a string variable
propertyName is one of the properties
methodName is one of the methods.
NAME="submitName" specifies the name of the submit object You can access
this value using the name property
VALUE="buttonText" specifies the label to display on the button face You can
access this value using the value property