SMTP Server Relay using Windows 2008 server

SMTP Relay Server         

SMTP Server Relay using Windows 2008 server 

What is needed?

•             A Windows 2008 server machine with a static IP address

•             IIS and SMTP service already setup on the machine (This can be done by “Add Features” functionality under Server Management).

Guide to a simple SMTP configuration.  

Refer to the figure given below.

First, create a domain by right-clicking the “Domains” node. You can see the domain name “your-domain.biz”. Note that it has been setup as a “Remote” domain.

Figure 1 - Creating a Remote domain
Figure 1 - Creating a Remote domain

Now, add properties to this domain. Right-click the domain name and select “Properties” from the short cut menu options.

Figure 2 - Setting the domain properties
Figure 2 - Setting the domain properties

The properties screen is invoked. The screen contains entries that are relevant to SMTP setting for the inbound.

In the General tab, enable the checkbox labeled as “Allow incoming mail to be relayed to this domain”.

In the “Route domain” set of options, check the option “Forward all mail to smart host”. Note that we have given the smart host as “smtp.1and1.com”.

Figure 3 - Setting Domain Root properties
Figure 3 - Setting Domain Root properties

Once the domain property has been setup, we can proceed for setting up the properties related to the SMTP.

Right-click the SMTP Service node and select “Properties”. Here’s where we set the properties that related to the SMTP outbound. This will enable the emails coming in to be relayed and passed out of the server.

Figure 4 - Setting SMTP root folder properties
Figure 4 - Setting SMTP root folder properties

Go to the “Access” tab and click the “Relay” button to setup the relay restrictions. This will enable us to specifically lay restrictions on the relay in order to avoid setting up the relay server as an Open relay. An open relay is susceptible to spamming and unauthorized mails.

Figure 5 - Setting ACCESS tab
Figure 5 - Setting ACCESS tab

As seen in the figure below, the relay restrictions screen is invoked. On this screen, we will be able to specify the list of computers which can relay through this server.

You will notice the IP address for localhost added. This is mandatory, hence the entries for 127.0.0.1 and also the IP address xxx.xx.xxx.xxx.

Figure 6 - Setting Relay restrictions
Figure 6 - Setting Relay restrictions

Go to the “Delivery” tab and you will see three buttons namely “Outbound Security”, “Outbound Connections” and “Advanced…”.

First click the button “Outbound Security” and select “Basic Authentication”. Enter appropriate credentials as indicated in the figure below.

Figure 7 - Setting Outbound Security for SMPT outbounds
Figure 7 - Setting Outbound Security for SMPT outbounds

Click the “Advanced…” button to invoke the associated popup screen. Enter the appropriate details for the “Fully-Qualified Domain Name” and the “Smart Host”.

Figure 8 - Advanced Delivery settings for SMTP
Figure 8 - Advanced Delivery settings for SMTP

Testing the relay server.              

In order to test the server relay, we will use telnet.

You will find a sequence of commands given below to be executed using telnet. The details given in the font courier new and set to italics/ bold denote the comments you execute using telnet.

On the command prompt type

telnet xxx.xx.xxx.xxx 25 (xxx.xx.xxx.xxx is your domain IP address and 25 is the open port number)

ehlo your-domain.biz (to verify the connect to your-domain)

mail from : myemailaddress@your-domain.biz

rcpt to : recipientaddress@other-domain.com

data (will enable you to type data below)

Hi,

This is a sample email

.      (period is used here to stop the data)

You will be prompted by an indication that your email has been queued for delivery

Now type

Quit (to quit telnet)

In the mailroot folder, you will find the resultant email in the “Queue” folder.

Once the email is delivered through your relay server, you will find that the “Queue” folder gets empty indicating that the mail has been passed successfully to the recipient.

Advertisements

One thought on “SMTP Server Relay using Windows 2008 server”

  1. I also tested by writing a simple VBS (VBScript) program that could reside on a different (client) machine with the SMTP server credentials.

    Run this program and you could see the email being sent through the relay server.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s