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.
Now, add properties to this domain. Right-click the domain name and select “Properties” from the short cut menu options.
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”.
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.
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.
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.
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.
Click the “Advanced…” button to invoke the associated popup screen. Enter the appropriate details for the “Fully-Qualified Domain Name” and the “Smart Host”.
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 : email@example.com
rcpt to : firstname.lastname@example.org
data (will enable you to type data below)
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
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.