Setup Windows Server SMTP Relay

This article explains how to create an SMTP relay on windows server. We have found that after migrating businesses to Office365 there are certain applications that need to send emails. By creating a local SMTP relay you bypass the need to relay the emails through Office365.

In this example we are installing and SMTP relay on Windows 2008r2

Pre-requisites

The server that will be acting as an SMTP relay must be allowed through the firewall for outbound port 25 connections.

Step 1 – Add SMTP server feature

Select SMTP server. It will ask you to install the pre-requisite roles which you will need to do.

 

Step 2 – Allow Relay

Open IIS Manager and go to the relay section of the SMTP virtual server (as shown below).

Enter the IP of the servers you would like to relay though this.

Step 3 – Configure Application

In the below example I have configured Veeam to use this server

 

Best Practise

As you have just created a non-registered SMTP server, there is a high chance that this email may be classed as spam. The below list will help ensure your email reaches its destination but are out of the scope of this article. You may want to

  1. Add the sending address to a whitelist (e.g. mimecast permitted senders)
  2. Add public IP used by the server to an allow list (such as the office365 allow list)
  3. Setup PTR record for the public IP used by this server
  4. Update SPF records to include the public IP used by this server

THE END

Leave a Reply

Your email address will not be published. Required fields are marked *