Understanding SMTP and Exchange Server 2003

 

Before configuring your Exchange Server organization to send and receive mail, you should have a good understanding of how Simple Mail Transfer Protocol (SMTP) enables message flow in Microsoft® ExchangeServer 2003. ExchangeServer 2003 uses SMTP to deliver internal mail between Exchange servers and routing groups. Similarly, Exchange Server 2003 uses SMTP to deliver Internet mail outside the Exchange organization.

SMTP is the Internet standard for transporting and delivering electronic messages. Based on specifications in Request For Comments (RFC) 2821 and RFC 2822, the Microsoft SMTP service is included in Microsoft Windows® 2000Server and WindowsServer™ 2003.

The Windows SMTP service is a component of Internet Information Services (IIS) and runs as part of Inetinfo.exe. Exchange Server 2003 relies on the Windows SMTP service as its native transport protocol; therefore, Exchange uses SMTP to route all internal and external messages.

How Exchange Server Extends SMTP Functionality

When Exchange Server is installed, it extends the underlying SMTP functionality by:

  • Moving management of the SMTP service (by means of SMTP virtual servers) from the IIS administrative console to Exchange System Manager.

  • Implementing support for link state information. Exchange uses link state information to determine the best method for sending messages between servers, based on the current status of messaging connectivity and cost, and the associated expense of the route that you define based on your topology.

  • Extending SMTP to support the command verbs that are used to support link state routing and other Exchange functionality. The following commands are added when Exchange is installed:

    • X-EXPS GSSAPI

    • X-EXPS=LOGIN

    • X-EXCH50

    • X-LINK2STATE

    Note

    For a list of all the SMTP commands and their definitions, see SMTP Commands and Definitions.

  • Setting up an Exchange Installable File System (IFS) store driver to allow message retrieval from and delivery to the Exchange store.

  • Setting the disk location where messages are queued to \exchsrv\mailroot\vs 1\queue. This is the location of the first SMTP virtual server on the Exchange server. If you add a second SMTP virtual server, Exchange creates an additional location (\exchsrv\mailroot\vs 2\queue).

  • Implementing support for advanced queuing. Exchange enhances the queuing capabilities of Windows 2000 and Windows Server 2003. The advanced queuing engine handles underlying transport functions in Exchange.

  • Enhancing message categorization. Message categorization is a process performed by the message categorizer, a component of the advanced queuing engine. The categorizer sends Lightweight Directory Access Protocol (LDAP) queries to the global catalog server to retrieve user and configuration information stored in Microsoft Active Directory® directory service. The message categorizer retrieves recipient policy information and Exchange virtual server information to enable message delivery. It uses this information to validate the recipient address, to verify that message limits are not exceeded, and ultimately to determine how the message is delivered using Exchange routing and SMTP.

An important concept to understand about SMTP and Exchange 2000 Server and later versions is the interaction among Exchange, Active Directory, and the IIS metabase. With Exchange System Manager, any configuration changes you make (such as to your recipient policies and SMTP virtual servers) are written to Active Directory, allowing for easy and remote administration. However, because the SMTP service reads its settings from the IIS metabase, the DS2MB service, which is a component of Exchange System Attendant, replicates this information from Active Directory into the local server's IIS metabase.

Receiving Internet Mail

If the following conditions exist, Exchange Server 2003 is able to receive Internet mail in its default configuration:

  • There is a constant connection to the Internet.

    Note

    Dial-up connections to the Internet require special configuration. For more information about dial-up connections, see How to Set a Connector Schedule.

  • The external Domain Name System (DNS) servers for your domain must have mail exchanger (MX) resource records pointing to your mail servers, or, if you are using an Internet service provider (ISP) or an external system, this external system must have an MX record for your domain and a mechanism to forward mail to your Exchange servers.

  • Your mail server must be accessible to other servers on the Internet. If you are using an ISP or external system to receive your mail, this external system must be able to contact your Exchange servers to deliver your mail.

  • Your recipient policies must be configured correctly. To receive Internet mail, you must configure a recipient policy that contains an address space matching the SMTP domain. Also, your Exchange organization must be responsible for delivering mail to this address (this is the default setting). For example, to accept Internet mail for ted@example.com, you must have a recipient policy that contains @example.com. However, there are some exceptions to this rule.

Inbound Internet mail flows through an Exchange server in the following manner:

  1. The sending SMTP server queries DNS to locate the IP address of the recipient's SMTP mail server.

  2. The sending SMTP server then initiates a conversation on the recipient's SMTP server (on port 25). On an Exchange gateway, the recipient's SMTP server is the SMTP virtual server that is configured to accept inbound Internet mail.

  3. Ideally, the inbound SMTP server only accepts the incoming message if it is destined for a recipient of its SMTP mail domain. These recipients are defined in the recipient policies (unless the server is open to relay, which is strongly discouraged).

    Note

    If you leave your system open for relay, unauthorized users can use your servers to send mail to external addresses. As a result, your system may be block listed—a process that blocks mail from servers that are suspected of sending unsolicited commercial e-mail (spam).

  4. When the message is accepted, the SMTP virtual server uses the transport mechanisms within Exchange to determine the method for delivering the message. Exchange locates the recipient in Active Directory and determines which server in the Exchange organization will deliver the message.

  5. Finally, the SMTP virtual server uses its internal transport mechanisms to deliver the message to the appropriate Exchange server.

Sending Internet Mail

Assuming there is a constant Internet connection, Exchange sends Internet mail by the following methods:

  • It uses DNS directly to contact the remote mail server.

  • It routes mail through a smart host that assumes responsibility for DNS name resolution and mail delivery.

Before each of these methods is described in detail, you should have a general understanding of how outbound mail flows in an Exchange organization.

Outbound Internet mail flows through an Exchange Server 2003 server in the following manner:

  1. An internal user sends a message to a recipient in a remote domain.

  2. To determine if the recipient is local or remote, the SMTP virtual server on the sender's Exchange server uses internal transport functions to query the global catalog server for the recipient address. If the recipient address on the message is not in a recipient policy, it is not stored in Active Directory; therefore, Exchange determines that the message is destined for a remote domain.

  3. If necessary, the Exchange server delivers the message to the appropriate SMTP virtual server.

  4. The SMTP virtual server uses its IIS metabase information to determine the method for delivering a message to a remote domain.

  5. The SMTP virtual server on the Exchange server then performs one of two actions:

    • Uses DNS to look up the IP address for the target domain, and then attempts to deliver the message.

    • Forwards the message to a smart host that assumes responsibility for the DNS resolution and delivery of the message.