Skip navigation

Using ETRN in Exchange Server

Small companies usually need an Internet connection to send their electronic messages, but their email volume might not justify the expense of a dedicated line. When you don't need 24-hour email connectivity, ETRN support in Exchange Server's Internet Mail Service (IMS) offers a fast, easy solution for Internet connectivity. This SMTP command lets you use your Exchange server to periodically connect to an ISP to send and retrieve your SMTP mail.

To take advantage of ETRN's functionality, you need to understand how ETRN works and how to configure it. In this discussion, I assume that you're using Exchange Server, except where I state otherwise.

ETRN Concepts
Exchange Server 5.0 Service Pack 1 (SP1) added ETRN support for SMTP connectors, and Exchange Server 5.5 incorporated ETRN in the IMS. Before Microsoft enhanced ETRN, you used the TURN command (another SMTP command) to extend SMTP to quickly dial up an ISP, transfer mail, and disconnect. However, TURN initially had a security hole: It couldn't authenticate the client. The result was that a clandestine host could impersonate a valid SMTP server and download someone else's mail. Microsoft uses ETRN as an enhancement to provide authentication.

ETRN is an SMTP service extension (ESMTP) command. (For more information about ETRN and ESMTP, see Request for Comments—RFC—1869: SMTP Service Extensions—ESMTP—and RFC 1985: SMTP Service Extension for Remote Message Queue Starting—ETRN—at ESMTP lets the server and client recognize each other as providing ESMTP functionality. Using ETRN, the called mail server can create a connection pointing back to a defined client (i.e., the requesting server) and therefore provide a more secure mechanism than the original TURN command can. After the requesting server establishes a connection, the mail server sends its queued mail.

Here are the steps in a typical mail transfer:

  1. An email client from sends a message to a recipient outside the client's domain (e.g., to [email protected]).
  2. Because the message is in SMTP format, Exchange Server uses an SMTP gateway (the IMS) as the connector. To resolve the destination domain name to an IP address, the server queries the Domain Name System. The DNS server finds several IP address entries for and selects the lowest cost value.
  3. Using the IMS, the XYZ server attempts delivery. However, the server is currently offline from the Internet. (If were connected to the Internet, it would receive the message, and you wouldn't need the ISP server.)
  4. Next, the XYZ server uses the secondary DNS address and successfully transfers the message to the server.
  5. At a predetermined interval, the server dials up the server and uses the ETRN command to send its email.
  6. The server then establishes a connection back to and dequeues (or sends) the messages addressed for it.

Now that you understand the process, let's configure your server for ETRN.

Setting Up the RAS Software
For this article, I assume that you're using a modem or an ISDN card that installs as a modem. First, you need to install RAS on your Exchange server. Go to the Network applet in Control Panel; on the Services tab, select Remote Access Service and click Add.

During the RAS setup, you can fine-tune a few settings. For instance, you generally need to configure only your computer as a RAS client. To configure your computer for outgoing RAS connectivity, select Remote Access Services during setup and click Properties. On the Remote Access Setup screen, click Configure, then under Port Usage, click Dial out only. Next, be sure that your dial-out protocol is TCP/IP because the IMS can use only the TCP/IP protocol. On the Remote Access Setup screen, click Network and select only TCP/IP under Dial-out Protocols. Finally, at the prompt, reboot the server to initialize the system.

To configure a phone book entry to dial the ISP, open My Computer from the desktop, and double-click Dial-Up Networking. Click New, and follow the Wizard's instructions. Of course, your ISP must have installed the RAS server software so it can answer the RAS client's call. When you've completed this entry, you can use the Microsoft Exchange Administrator program to configure ETRN.

Configuring ETRN on the Server and the Client
To set up ETRN, you need to configure the server and the client separately. The ISP usually configures the server side. The setup is simple if your ISP is using Exchange Server. Go to the Connections tab of the IMS property sheet. Under Message delivery, click E-Mail Domain. Add the customer's domain name and select the Queue messages for ETRN check box, as you see in Screen 1. If you don't check this box, the ISP server will immediately attempt to deliver messages even though the ETRN client is offline. Checking this box prevents unsuccessful retries and nondelivery reports (NDRs) back to the originator. ISPs that don't use Exchange Servers can configure the Sendmail utility for ETRN capability.

The ETRN client requires more complex configuration. First, configure when the ETRN client sends mail. If you're using RAS, be sure you've configured the RAS client and a phone book entry pointing to your ISP before you begin. From Exchange Server, go to the IMS property sheet to configure your connector for ETRN dial-up. From the Dial-up Connections tab, which Screen 2 shows, choose the appropriate remote access entry from the Available connections window.

Next, decide on a schedule for calling your ISP. As Screen 2 shows, you have several options, including transferring mail at specific intervals or whenever mail is queued up. Note that you don't explicitly define when to close the connection. The IMS terminates the connection depending on the setting in the Time-out after X min window. This parameter refers to idle time; the connection closes after the number of minutes you specify have passed. Your ISP must be able to dequeue your inbound mail within this period, or the connection will close prematurely. The connection might close if the dequeue process doesn't proceed in a timely fashion after you've established the connection with the ISP. You can accommodate a slow start of the dequeuing process by increasing the time value.

You configure logon validation for the dial-up connection by clicking Logon Information on the Dial-up Connectors tab. On the screen that opens, enter your username, password, and domain (if appropriate). This information (which your ISP gives you) provides the credentials for ETRN to match against the server and provides security between the two servers.

To configure ETRN to let your ISP send your mail to you, click Mail Retrieval to get to the screen that you see in Screen 3. Click Retrieve mail using ETRN. To specify the proper Internet domain, you can use the Routing property page (from the IMS property sheet) or hard-code your domain names by selecting Use these domains and entering domains in the window. The latter option signals the ISP to dequeue messages from this domain only. If you've defined subdomains, precede the domain name with an at (@) character to collect mail for all domains. Subdomains let you partition companies into operating units with separate email addresses. For example, the Internet domain has several subdomains, such as and If your ISP has defined separate hosts for inbound and outbound messages, you can select Send ETRN to specified host instead of outbound mail host and define the IP address of the inbound host.

If your service provider uses the TURN command instead of ETRN, you can click Issue TURN after delivering outbound mail. If you use this option, your ISP might need to authenticate your identity, if the ISP has this functionality. You can configure these credentials (e.g., name and password) on the Security tab of the IMS property sheet. This authentication usually uses the AUTH LOGIN ESMTP extension to send the account and password on the outbound connection.

If your ISP uses UNIX instead of Exchange Server, you can use the UNIX Sendmail application to dequeue messages from the ISP's SMTP gateway for delivery to the ETRN client. To configure Sendmail, select Custom command to invoke a script that uses the Sendmail function. You enter the script in the window next to the option. For instance, the remote shell command (Rsh) causes Sendmail to run at the service provider after you've established a connection. For example, the syntax

Rsh  I  l logonalias "/user/lib/sendmail  q  R"

starts the remote shell, then connects to a service provider called The logon alias starts the shell at the ISP (this alias must match the rhosts file on the ISP). The rest of the command executes the remote shell and sends the queue to the specified domain (

The final step in the client portion of ETRN setup is to configure your server to queue mail in the IMS for later transfer to your ISP via ETRN. On the IMS Connections tab, which Screen 4 shows, select Forward all messages to host under Message Delivery, and then enter your ISP's IP address. Check the Dial using check box, and be sure the correct RAS phone book entry appears in the adjacent window.

Optimizing ETRN for Performance
Both client and server can benefit from limiting message size over the WAN link. You can limit message size on the General tab of the IMS. However, be aware that these limits are global for that IMS; so you can't set them for each domain. The IMS checks outbound messages before it sends them to ensure messages don't exceed the size limit. If messages exceed the size limit, the IMS returns them to the originating recipient as nondeliverable.

You can also disable notifications for queued mail by clicking Time-outs, which Screen 4 shows. If you don't disable notifications, a sender will receive an NDR for an urgent message if it sits in the queue over 4 hours. Also, don't forget to install Exchange Server 5.5 SP1 or a later service pack to fix a bug that causes queued messages to never expire because they're waiting for the ETRN command.

Any time you can choose between an IP address and a host name in a property sheet, always choose an IP address to avoid name resolution via DNS, HOSTS file, or WINS lookup. Name resolution slows down your system. For example, in Screen 1, I specified the IP address of the ETRN client instead of relying on the DNS.

You frequently can find workarounds for ETRN dequeue problems. For example, if you're using a dial-up connection, Exchange can prompt another Exchange host to dequeue SMTP messages automatically. If you use another connection (e.g., dial-on-demand routers), you must find a way to send this prompt command manually. The Microsoft article "XFOR: Dequeuing SMTP Messages Outside of Dial-up Connections" ( kb/articles/q175/4/94.asp) describes this process in detail. The Simpler-Webb Web site ( offers a utility (dequeue.exe) for prompting the host. You can also use the Windows NT Schedule service to schedule this prompt.

If you're using dial-on-demand routers and an ISDN line for the Internet connection to the ISP, remember that the default timeout interval for a Cisco router is 2 minutes. If the ISP can't dequeue in this interval, increase the timeout value on the Cisco router, not the Exchange server.

Work with Your ISP
Perhaps the biggest hurdle in using ETRN is convincing your ISP to help you set up ETRN. ETRN works best in a low-volume email environment where you connect many times a day to transfer a dozen or more messages. If your company transfers more than 300 messages a day, you might want to consider a dedicated line to the Internet.

You can also work with your ISP on such concerns as DNS name resolution. Designating the ISP as the primary DNS record and the company as the secondary record is more efficient because correspondents can generally send messages to the ISP 24 x 7 for the ETRN client to pick up later. You can also negotiate with your ISP when you want to pick up inbound messages and send outbound messages. You don't have to perform both operations during one connection. You can choose to send messages immediately and pick up your inbound mail at other times.

For more information about Exchange and dial-up functionality, including dial-up routers (which require a different ETRN configuration), the Simpler-Webb Web site provides resources (e.g., third-party tools and utilities) about how to set up your site. Another great resource for setting up dial-up and ETRN is the ISP Connectivity White Paper on TechNet. This paper describes how to configure Microsoft Small Business Server (SBS) to work with existing ISPs for Exchange dial-up messaging.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.