Foundations of Python Network Programming 978-1-4302-3004-5
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
CHAPTER 13 ■ SMTP<br />
The Move to Webmail<br />
And, finally, yet another generational shift has occurred on the Internet.<br />
Users once had to download and install a plethora <strong>of</strong> clients in order to experience all that the<br />
Internet had to <strong>of</strong>fer; many older readers will remember having Windows or Mac machines on which<br />
they eventually installed client programs for such diverse protocols as Telnet, FTP, the Gopher directory<br />
service, Usenet newsgroups, and, when it came along, a World Wide Web browser. (Unix users typically<br />
found clients for each basic protocol already installed when they first logged in to a well-configured<br />
machine, though they might have chosen to install more advanced replacements for some <strong>of</strong> the<br />
programs, like ncftp in place <strong>of</strong> the clunky default FTP client.)<br />
But, no longer!<br />
The average Internet user today knows only a single client: their web browser. Thanks to the fact<br />
that web pages can now use JavaScript to respond and re-draw themselves as the user clicks and types,<br />
the Web is not only replacing all traditional Internet protocols—users browse and fetch files on web<br />
pages, not through FTP; they read message boards, rather than connecting to the Usenet—but it is also<br />
obviating the need for many traditional desktop clients. Why convince thousands <strong>of</strong> users to download<br />
and install a client, clicking through several warnings about how your s<strong>of</strong>tware might harm their<br />
computer, if your application is one that could be <strong>of</strong>fered through an interactive web page?<br />
In fact, the web browser has become so preeminent that many Internet users are not even aware<br />
that they have a web browser. They therefore use the words “Internet” and “Web” interchangeably, and<br />
think that both terms refer to “all those documents and links that give me Facebook and YouTube and<br />
the Wikipedia.” This obliviousness to the fact that they are viewing the Web’s glory through some<br />
particular client program with a name and identity—say through the dingy pane <strong>of</strong> Internet Explorer—is<br />
a constant frustration to evangelists for alternatives like Firefox, Google Chrome, and Opera, who find it<br />
difficult to convince people to change from a program that they are not even aware they are using!<br />
Obviously, if such users are to read e-mail, it must be presented to them on a web page, where they<br />
read incoming mail, sort it into folders, and compose and send replies. And so there exist many web sites<br />
<strong>of</strong>fering e-mail services through the browser—Gmail and Yahoo! Mail being among the most popular—<br />
as well as server s<strong>of</strong>tware, like the popular SquirrelMail, that system administrators can install if they<br />
want to <strong>of</strong>fer webmail to users at their school or business.<br />
What does this transition mean for e-mail protocols, and the network?<br />
Interestingly enough, the webmail phenomenon essentially moves us back in time, to the simpler<br />
days when e-mail submission and e-mail reading were private affairs, confined to a single mainframe<br />
server and usually not using public protocols at all. Of course, these modern services—especially the<br />
ones run by large ISPs, and companies like Google and Yahoo!—must be gargantuan affairs, involving<br />
hundreds <strong>of</strong> servers at locations around the world; so, certainly, network protocols are doubtless<br />
involved at every level <strong>of</strong> e-mail storage and retrieval.<br />
But the point is that these are now private transactions, internal to the organization running the<br />
webmail service. You browse e-mail in your web browser; you write e-mail using the same interface; and<br />
when you hit “Send,” well, who knows what protocol Google or Yahoo! uses internally to pass the new<br />
message from the web server receiving your HTTP POST to a mail queue from which it can be delivered?<br />
It could be SMTP; it could be an in-house RPC protocol; or it could even be an operation on common<br />
filesystems to which the web and e-mail servers are connected.<br />
For the purpose <strong>of</strong> this book, the important thing is that—unless you are an engineer working at<br />
such an organization—you will never see whether POP, or IMAP, or something else is at work, sitting<br />
behind the webmail interface and manipulating your messages.<br />
E-mail browsing and submission, therefore, become a black box: your browser interacts with a web<br />
API, and on the other end, you will see plain old SMTP connections originating from and going to the<br />
large organization as mail is delivered in each direction. But in the world <strong>of</strong> webmail, client protocols are<br />
removed from the equation, taking us back to the old days <strong>of</strong> pure server-to-server unauthenticated<br />
SMTP.<br />
220