Abstract
IIS includes support for the Simple Mail Transfer Protocol, the predominant protocol used to transport email throughout the Internet. In this chapter, you will learn how to install and configure the Microsoft SMTP Service, configure the SMTP Service to host message traffic, and optimize performance of the SMTP Service. The chapter ends with a quiz and suggested activities.
The Simple Mail Transfer Protocol (SMTP), the predominant protocol used to transport e-mail throughout the Internet, has revolutionized the way many companies do business. IIS includes support for both protocols for use in private intranets or on the Internet.
Upon completion of this module, you will be able to
Install and configure the Microsoft SMTP Service
Configure the SMTP Service to host message traffic
Optimize performance of the SMTP Service
OVERVIEW OF SMTP
When you send e-mail, the recipient does not have to be online when the message is sent. Your e-mail application uploads the message to a server running SMTP, which stores the message until the recipients SMTP server is available, then forwards the message. The recipients SMTP server runs another service that places the message into the recipients mailbox, where it waits for the recipient to use yet a different protocol, such as Post Office Protocol version 3 (POP3) or Internet Message Access Protocol (IMAP), to download the message.
Note: Neither SMTP nor IIS can sort incoming e-mail into mailboxes and let users check their e-mail. Installing the SMTP Service does not install POP3 or IMAP, which permit users to have separate private message storage areas. SMTP support is only for sending e-mail between mail servers.
The SMTP Service included with IIS is 100 percent compliant with the Request For Comments (RFCs 821 and 822) that define how e-mail should be sent over the Internet. The SMTP Service gives Web application developers an easy way to include e-mail functionality in their applications.
SMTP SERVICE INSTALLATION
The SMTP Service installs as an optional subcomponent of IIS. Its hardware and software requirements are identical to the requirements for IIS.
A set of special folders is created for SMTP to use. The default location for this folder set is C:\Inetpub\Mailroot, but you can choose a different location during setup (however, the Mailroot folder must be located in the same partition as the SMTP Service files). Table 9.1 describes the different subfolders of \Inetpub\Mailroot. Well discuss their exact functions later in this module.
CONTROLLING AND MONITORING THE SMTP SERVICE
You can stop, start, pause, and resume the SMTP Service with either the Services applet in Control Panel or the Rebar in Internet Service Manager. From the command line, you can achieve the same results by typing one of the following:
net stop smtpsvc
net start smtpsvc
net pause smtpsvc
net continue smtpsvc
Once paused, the SMTP Service continues to deliver and receive messages over connections established before the service was paused, but no new connections can be made. If stopped, the SMTP Service immediately terminates all connections.
All events that the SMTP Service generates are recorded in the System Log of the Event Viewer. In addition, counters are added to Performance Monitor for the SMTP Service.
OVERVIEW OF THE MESSAGE DELIVERY PROCESS
Before you deliver a message with SMTP, it must be placed under the control of the SMTP Service. There are three methods of giving a message to the SMTP Service for delivery.
One method is to use an e-mail client, such as Microsoft Outlook Express. In the client application, specify the IIS server as the outgoing SMTP server for sending messages, then compose and send Internet e-mail in the regular way. (The application cannot download messages from the users mailbox this way, though.)
A second way to hand control of a message to the SMTP Service is to place a properly formatted text file in the Mailroot\Pickup folder. What qualifies as properly formatted is defined in RFCs 821 and 822, but includes, for example, the senders and receivers e-mail addresses in the header. All files copied to the Mailroot\Pickup folder are processed and delivered as regular mail. You can move a single file or many thousands of files into the Mailroot\Pickup folder for delivery, either manually or with a custom program or batch file.
Lets give this method a try.
Open Notepad and type
x-sender: jason@mycorp
x-receiver: leslie@mycorp
From: jason@mycorp
To: leslie@mycorp
Subject: Results are in.
We have won!
Add two extra blank lines at the end.
Expand your Default SMTP Site in Internet Service Manager, and select the Domains object.
In the Results Pane, note the name of your default local domain name; replace mycorp in Notepad with the name of your default local domain.
Save this file, using any file name, to the Mailroot\Pickup folder.
Check the Mailroot\Drop folder for a new file with an .eml extension (it will not have the same name as the file you saved). Open this message in Notepad.
If your message did not arrive, check the Mailroot\Queue folder, where messages not destined for a local domain are sent.
The third method for giving a message to the SMTP Service for delivery requires another SMTP server (Microsoft or otherwise). The remote SMTP server connects to IIS, attaches to the SMTP Service on port 25 (the default), and passes along any messages destined for e-mail domains hosted on the IIS server. Or, if the SMTP Service is configured to relay messages to domains hosted on other SMTP servers, the remote SMTP server passes along messages for routing to these other servers.
In each case, the SMTP Service acquires the message and places it in the Mailroot\Queue folder. IIS attempts to send any new messages deposited in this folder right away. If immediate delivery is not possible perhaps due to congestion at the receiving SMTP server IIS resends queued messages (you can configure the number of retries and intervals). You cannot place messages directly into Mailroot\Queue (as you can with the Pickup folder) because the messages will not be properly formatted and numbered.
When the destination of the message is an e-mail domain hosted on the IIS server itself, the message file is placed in the Mailroot\Drop folder. This is the end of SMTP processing; the SMTP Services job is done.
However, when the SMTP Service receives a message with a remote domain destination, IIS connects directly to an SMTP server for that domain and relays the message. IIS finds the IP address of the remote SMTP server by querying DNS. DNS servers maintain special records (MX records) that map e-mail domains to the IP addresses of the SMTP servers responsible for those domains. For example, if a recipients e-mail address is leslie@mail .mycorp.com, the e-mail domain is mail.mycorp.com. The SMTP Service connects to remote systems on port 25, unless configured otherwise.
Order Your SQL Fundamentals CD Today! Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD.
You've Deployed SharePoint...Now What? This one-day free online conference delivers the technical knowledge needed to kick MOSS up a notch. In one information-packed day, independent SharePoint experts will present practical, real-world information and provide take-away, ready-to-use solutions
What Would You Do If You Ran Microsoft? ITTV's 2008 inaugural video contest, "If I Ran Microsoft..." is your chance to tell it like it is. Be goofy or be serious, but don"t miss this chance to have fun, win prizes, and go viral in a major way.
Maximize Your SharePoint Investment This web seminar discusses how true bi-directional replication of SharePoint content from one server to another enables branch offices to maintain access to current SharePoint content.