Software

Enabling the SMTP Service on IIS 4.0

What do you do if you're running IIS and want to route SMTP from your Web pages? You can use Exchange, but if you don't want to burden your Exchange Server, you can also add the SMTP Service to your IIS 4.0 server. Ron Nutter shows you how.


At some point when you’ve been running Internet Information Server (IIS), you’ll want to e-mail information from IIS without routing it through your Exchange Server. You can accomplish this easily by installing the Simple Mail Transport Protocol (SMTP) Service for IIS. The service is not enabled when you install IIS from the Option Pack CD, but it’s not difficult to add when you’re ready to implement it. In this Daily Feature, I’ll show you how.

Why would I want SMTP on IIS?
You can use your Exchange Server to provide SMTP for IIS if you want. However, in some instances that may not be the best solution. For example, in order for SMTP to work with Active Server Pages (ASP) Web pages, the Exchange Server would have to reside on the same server as IIS does. Because such an arrangement may not be practical, having the SMTP Service available for IIS is a good idea.

Backing up IIS and the metabase
As with any changes to NT, you should have at least one good backup of your server before adding this service. I also suggest you make a backup of the metabase that IIS and the SMTP Service will use. You should do this on a monthly basis or whenever you make significant changes to either IIS or the SMTP Service.

There’s no way of backing up the metabase from the command line automatically, so you’ll need to perform this step whenever the opportunity presents itself. Open the IIS Microsoft Management Console (MMC) by selecting Start | Programs | Windows NT 4.0 Option Pack | Microsoft Internet Information Server | Internet Service Manager. Click the Action button, then click the Backup/Restore Configuration option.

When the Configuration Backup/Restore window appears, click the Create Backup button. The resulting Configuration Backup window lets you specify a name for the backup. In our case, since this will be the first backup of the metabase, enter Initial Metabase Backup. Then, click OK. After the backup finishes, you should see a listing with the name of the backup in the Backups window. Click Close to return to the MMC window.

Installing the SMTP Service
For the purposes of this Daily Feature, I’ll assume you already have IIS 4.0 installed on your NT Server and want to add the SMTP Service. To begin, click Start | Programs | Windows NT 4.0 Option Pack | Windows NT 4.0 Option Pack Setup. When the Option Pack Setup screen appears, click Next. On the screen that follows, click Add/Remove. The next screen lets you select the components you want to install or remove.

Select Internet Information Server (IIS) and then click the Show Subcomponents button just below the list of components. The next window contains a listing of IIS services and additional components. Look for an entry called SMTP Service; then click the check box to the left of that entry and click OK.

You’ll then return to the screen where you selected Internet Information Server. Click Next, and you’ll see the Microsoft SMTP And NNTP Service Setup window. By default, under Mailbox Directory you should see C:\Inetpub\Mailroot. (The drive letter may be different depending on which physical drive IIS is installed on.)

After verifying the path is correct, click Next. Setup will copy the necessary files (you’ll see a progress screen). If the files needed to install the SMTP Service aren’t on the server’s hard drive, you’ll have the choice of browsing the NT Options Pack CD for the files or downloading them from the Web. If you choose the latter option, you must select the site you want to download the files from. Highlight the best site for your location (if you have a choice of more than one) and click OK. After the files download, you’ll see a Security Warning screen asking if you want to install and run Windows NT 4.0 Option Pack. Click Yes.

You’ll see a screen indicating the progress of the file-copying process. If a file version conflict is detected, you can overwrite the original file if you wish, but I suggest clicking the No To All option.

Once all the files are copied, click Finish to exit the Option Pack Setup application. Since some system files have been changed, you should restart the server so that the SMTP Service can start properly. Simply click the Yes button to restart the server. Once you’ve logged in, reapply the last service pack you put on the server before you added the SMTP Service.

Configuring the SMTP Service
After you’ve reapplied the NT service pack and restarted the server, log in to the server with an Admin level account. Open the Service applet in Control Panel; you should see the Microsoft SMTP Service, with Started, Automatic next to it.

Now, you need to go to the MMC to configure the SMTP Service for IIS. Begin by clicking Start | Programs | Windows NT 4.0 Option Pack | Microsoft Internet Information Server | Internet Service Manager. When the MMC appears, click the plus sign beside Internet Information Server to view additional options. Click the plus sign beside the server you are working on. At the bottom of the list, you’ll see Default SMTP Site. Right-click on this entry, then select Properties to open a properties page for Default SMTP Site.

You’ll want to restrict others from using this SMTP Service to relay messages to other systems. The SMTP Service should be needed only by the IIS server to send messages out, so disabling the relaying ability shouldn’t present a problem. Click the Directory Security button and then click the Edit button in the Default SMTP Site Properties window.

When the Relay Restrictions screen appears, select the option Not Allowed To Relay. As an additional precaution, deselect the option Allow Any Computer That Successfully Authenticates To Relay. Then, click OK to return to the Default SMTP Site Properties window. You can tweak the other options later.

Conclusion
As I mentioned earlier, don’t forget to back up the metabase periodically. You shouldn’t have to make many changes to the SMTP Service unless the ASP page that’s referencing this service requires specific settings.
The authors and editors have taken care in preparation of the content contained herein but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.

Editor's Picks