Configuring SMTP and POP3 in the Exchange client, Outlook, and Outlook Express

Last month, I gave an overview of how Microsoft Exchange Server supports the Simple Mail Transfer Protocol (SMTP) and Post Office Protocol (POP) 3 email protocols (for a list of related articles, see "Related Articles in Windows NT Magazine," page 169). In this article, I'll describe how Microsoft's Exchange, Outlook, and Outlook Express email clients use these protocols, as well as Internet Message Access Protocol (IMAP), with Exchange Server 5.5. To help you get a real-world understanding of how Exchange Server interacts with these protocols and email clients, I will provide examples from the small network that I described last month, which Figure 1, page 166, shows.

Exchange and Outlook MAPI Clients
Most companies using Exchange Server as their messaging server use the Exchange or Outlook email client on the desktop. Many users assume that the Exchange client that comes with the default Windows NT or Windows 95 installation will deliver mail to an Exchange server. However, the free Exchange client delivers mail to only a Microsoft Mail Post Office for a workgroup. To connect to an Exchange server, you must install the full Exchange client from the Exchange Server CD-ROM or the Outlook client from the Outlook CD-ROM. (For the appropriate client software, always obtain the latest version from Microsoft.)

When you configure the full Exchange or Outlook client, you must add a delivery service to Exchange. Screen 1 on page 169 shows the Microsoft Exchange Server delivery service in my Outlook profile. With this delivery service, my desktop client takes any message I compose and delivers it to the Exchange Server using the Messaging API (MAPI) protocol. For example, I use Outlook on Patmos to submit an Exchange message to Athena. MAPI is a proprietary protocol that Microsoft first implemented in Microsoft Mail. Microsoft supplemented MAPI significantly in Exchange Server. If I send mail to someone within my Exchange organization, the Message Transfer Agents (MTAs) on the Exchange servers in the organization transport my message as a Microsoft proprietary formatted binary object, and you can access the data for this object with the MAPI interface. The recipient will most likely read the message using the same type of MAPI delivery service profile I have for Athena (the recipient's delivery service points to the recipient's mailbox server). As I discussed last month, nothing in the configuration of the delivery service on Patmos lets you or prevents you from sending mail to recipients outside the organization. If you use MAPI to submit mail to an Exchange server, the universe of recipients is a function of the gateways you install on the network.

Exchange and Outlook POP3 Clients
Individuals who want to receive Internet email at home often sign up with a local Internet Service Provider (ISP). Typically, these users are buying a dial-up connection, an account on a POP3 server, and permissions to access an SMTP server. These users connect to the POP3 server to download their mail, and connect to the SMTP server to send their mail. The ISP might use UNIX or Exchange-based servers and applications to handle the mail, and individual subscribers don't know which type of SMTP mail system they are connecting to. For example, if you contract with Erols, a popular ISP in the Washington, D.C., area, you will connect to a UNIX host running Sendmail--a connection you can verify by looking at the response from Erols' host:

220 smtp1.erols.com ESMTP Sendmail 8.8.8/8.8.5

By contrast, when you connect to my friend Mark's SMTP server (as I discussed last month), you get an NT host running Exchange. The response from this host is:

220 arlington.minasi.com ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.1960.3) ready

To send and receive mail, the subscribers can use any POP3 client. Your ISP might provide you with a popular freeware client such as the light version of Eudora or Pegasus, or you can configure your Microsoft email client to use the POP3 and SMTP delivery services. Again, many users have a misconception that the POP3 and SMTP delivery services are available with the free Exchange client that comes with the default NT and Win95 installation; however, you need to install the Outlook client from the Outlook CD-ROM or the Exchange client from the Win95 Plus! Pack or from the NT 4.0 CD-ROM to get these services. If you have the Outlook client, you get POP3 and SMTP protocol support when you add the Internet E-mail delivery service to your profile, as Screen 2 shows.

When you add the Internet E-mail delivery service (instead of MAPI), your desktop client will use POP3 to download mail and SMTP to send mail. Consequently, you need to configure the client so that the mail servers it points to are running these services. In my case, the Hermes server in Figure 1 is running the Internet Mail Service (IMS), so it is the SMTP server for my network. With Exchange Server, the Information Store (rather than the IMS) is responsible for POP3 support. Consequently, your POP3 server is the same server as the one that houses your mailbox (Athena in my case). Screen 3 shows my POP3 and SMTP Outlook profile.

POP3 requires that you supply a username and password to log on to the mail server. If you configure the Exchange or Outlook client with this service, you need to add the NT domain name, user account name, and password in the appropriate Login Information fields. The POP3 protocol specifies that the client machine transfer this information to the mail server in clear text (i.e., unencrypted). As a result, anyone on the LAN with a protocol analyzer can view your mail username and password. The Outlook client has an additional field that lets you specify that the ISP support Secure Password Authentication. This feature is new and not very common.

After you configure your Exchange or Outlook clients to transport mail using SMTP and POP3, you won't have to worry about what type of mail server (e.g., an Exchange server or a UNIX Sendmail host) you connect to. The typical configuration for most POP3 clients specifies that the user retrieve messages from the mail server and delete these messages from the server after downloading them. For example, if you have one message on the server, the client will issue a RETR 1 and a DELE 1 command. This common configuration works well if you access an ISP, because the ISP doesn't want you to leave old mail on the server (for storage reasons). However, this configuration doesn't work as well if you are using POP3 to read your office mail from the road. In this case, you don't want to delete your mail from the mail server, because you might want to access it again after you are back at the office. You can configure the Outlook POP3 delivery service to leave a copy of your mail messages on the server.

To make Outlook issue only the RETR command and not the DELE command, click the Advanced tab and select the Leave a copy of messages on server check box in the Internet E-mail service's properties dialog box, as Screen 4 shows. Now you will be able to use the regular MAPI client when you return to the office and read those messages you accessed while you were on the road. Note that you can also support POP3 authentication over Secure Sockets Layer (SSL), if the Exchange server requires it. When you configure the Outlook client to leave a copy of your messages on the server, the POP3 service will download copies of your new mail to the personal folders on your machine (a local .pst file) every time you connect to the server.

In some cases, you might want to view only the mail message headers, rather than download the entire message. To view just the headers, set the Internet E-Mail delivery service's connection type to manual, and set the delivery location to point to your .pst file. You can then use several remote tools instead of the default Check for New Mail. Screen 5, page 168, shows the Remote toolbar. The icon on the far left of the toolbar lets you download the message headers from the POP3 server, rather than the entire messages. When you click this icon, you will see the Remote Connection Wizard, as Screen 6 shows.

The wizard lets you specify the actions you want to take when you connect to the Exchange server from a remote location. In Screen 6, I have selected to retrieve new message headers and to send a single message with the subject "testing send via smtp." When I click Finish, the Outlook client will connect to the POP3 server, retrieve the new message headers from that server, and connect to the SMTP server to send the message. The POP3 TOP command retrieves the headers, and the sequence of commands issued by Outlook is

UIDL
TOP msg n

The UIDL command requests the Unique ID Listing (i.e., a list of message IDs for the user) for the messages on the server. The Outlook client issues the TOP 1 0 command, asking the POP3 server to provide the header of the first message, and waits until it receives this header. Outlook then issues the TOP 2 0 command, asking the POP3 server to provide the second header. Outlook continues issuing TOP n 0 commands until it receives the headers for all messages it had not previously seen. For example, if Outlook had already downloaded the headers for 10 messages in my mailbox during a previous connection, and the current UIDL command showed that 14 messages were waiting for me, Outlook would issue the TOP command for only the four messages I hadn't seen. After Outlook finishes downloading the message headers, it shows you the headers, as you can see in Screen 7.

Screen 7 shows one message and three message headers. The message headers appear with the envelope-and-telephone icon to signify that you haven't downloaded the message yet. If you double-click the message header, you see a dialog box in which you can specify whether you want to download the message or delete it from the mail server. The next time you connect to the server, Outlook will issue a RETR command or a DELE command, respectively.

Outlook Express POP3 and IMAP Clients
Outlook Express is Microsoft's newest email client. It supports POP3, IMAP, Lightweight Directory Access Protocol (LDAP), and Network News Transfer Protocol (NNTP), so it can replace the Microsoft Internet Mail and Internet News clients that Microsoft provides as add-ons for Internet Explorer (IE). Like Outlook, Outlook Express lets you add multiple delivery services into the shell; you can access multiple servers and services with the same client. Unlike Outlook, Outlook Express doesn't support multiple profiles. Instead, you put all the services you want in one profile. Outlook Express has a lot of features, but I want to highlight its POP3 and IMAP implementations from the protocol support point of view.

IMAP is a replacement for the POP3 protocol. IMAP supports more features and is more configurable. As I mentioned last month, a POP3 server listens on TCP port 110, sends logon credentials to the server with the USER and PASS commands, and downloads headers and mail with the TOP and RETR commands. An IMAP server listens on port 143, uses the LOGIN command to send the username and password to the server, selects your mailbox with the SELECT "INBOX" command, downloads headers with the FETCH...RFC822.HEADER command, and downloads your mail with the FETCH...BODY command. Like POP3, IMAP is a protocol for downloading mail. IMAP doesn't let you keep copies of mail on the server, and it downloads your messages automatically to your mailbox when you double-click the message. You must use a different protocol for sending mail. Outlook Express uses SMTP to send mail for both POP3 and IMAP clients.

To support POP3 or IMAP, you need to configure Outlook Express with the appropriate delivery service. To add a delivery service, select Accounts from the Tools menu in Outlook Express. You can view all the accounts (which are equivalent to Outlook's delivery services) from one window, or you can choose the tab for the type of account you want to see. In Screen 8, I've selected the tab that displays mail accounts, which shows delivery services for three mail servers (two POP3 and one IMAP). To add a new delivery service, click Add, select the type of service you want to include, and fill in the details. After you add a service, you can always return to the dialog box you see in Screen 8 to change a delivery service's properties. When adding a new delivery service, you need to supply the name of your POP3 or IMAP server and your SMTP server, as well as your authentication information, as you see in Screen 9.

I have added a delivery service for my POP3 server. The Outlook Express dialog box is similar to Outlook's POP3 properties dialog box. After all, the Internet governing boards, not Microsoft, define the requirements for the types of information you must provide to send and receive mail.

The original Outlook client had one disadvantage that newer versions of Outlook and Outlook Express have eliminated. POP3 is a protocol for downloading your mail from your mailbox. You need an account on the POP3 server, you need to identify yourself, and you must prove your identity to the POP3 server to get your mail. However, SMTP has no such requirement because it is a protocol for transferring mail. Nothing in the SMTP protocol identifies a user, and many organizations typically set up SMTP servers to act as relay hosts and let anyone bounce mail off them. With more sophisticated SMTP implementations (primarily to control unsolicited email and unauthorized use of the ISP's resources), many SMTP servers now require authentication. Users can and do use different machines for their POP3 and SMTP servers, and these systems might have different authentication requirements. The original Outlook client didn't have a way to let you enter separate logon information for the SMTP server, which limited how you could architect your mail solution. With newer releases of Outlook and Outlook Express, Microsoft added an Outgoing Mail Server section (as you see in Screen 9) to let you specify the SMTP server logon information separately from the POP3 information.

Outlook Express lets you configure mail delivery options for your POP3 mail in the same manner as Outlook. For example, if you select the Advanced properties tab for your POP3 delivery service in Outlook Express, you see the same options as you see in Outlook. After you configure Outlook Express, you can use it just as you use Outlook configured with the Internet E-mail delivery service.

Configuring the POP3 and SMTP protocols in the Microsoft email clients to use with Exchange servers is straightforward. In a future article, I'll discuss how you can set up and use other protocols, such as HTTP, with Exchange Server.