Harnessing Simple Mail Transfer Protocol for SharePoint
Need a Mail Server for SharePoint but don’t have a spare dedicated Mail Server? No problem! You can just use your SharePoint Server for mail with some relatively simple configuration adjustments!
First, you will need to decide which server or servers will be the mail server in your Farm. This will typically be the Web Front End, but can change depending on your SharePoint topology and needs. This server will need to have the IIS 6.0 and SMTP feature installed. This will be your first step.
Next, you must configure the SMTP and SharePoint configuration. You will first need to create an Alias in SMTP. To do so, open IIS 6.0, Expand SMTP Virtual Server, right-click Domains and select New and Domain. In the New Domain Wizard, select Alias and give your SMTP Server a name. This can really be almost anything, but I personally will usually go with something like mail.servername.
Now, we need to set some basic SMTP permissions. While IIS 6.0 is already open, we will right-click SMTP Virtual Server and select Properties. Now select the Access tab as seen below:
Click the Connection tab and ensure that ‘All except the list below’ is selected, with no entries in the list. This is signifying that the server will accept connection attempts from any server. This may sound like a security risk, but we will be using the Relay setting to secure this now.
Now select Relay as seen in the picture above and select only the list below. In the list, make sure you include 127.0.0.1, and any IP addresses of Web Front End’s in your SharePoint Farm on the Interface that talks to the server you are currently on. Now restart SMTP and SMTP should be configured. By changing what we will allow to relay, we have effectively limited any relay services to only servers in the SharePoint Farm, meaning we have not configured the dreaded Open Relay.
Now we will open and edit the hosts file. This is so we can make the Relay rule true for the mail server. This file is located at the following location:
We will need to edit this hosts file as follows:
**Remember that mail.servername is actually the Alias you set previously. By saving this entry to the hosts file, we are making this resolve to 127.0.0.1. Not only does this tell the server to send mail to itself, but it also makes the 127.0.0.1 Relay rule true, which allows the server to relay off of itself. Also, if your environment will only have this mail server, but multiple Web Front Ends, you will need to edit the hosts file of each Web Front End server to use this server’s internal IP for mail.servername.
Now it’s time to configure SharePoint with the correct information. To do so, start by opening Central Administration. Click on System Settings and then Configure outgoing e-mail settings.
As you can see above, you will use the mail.servername for the Outbound SMTP server.
The From address can really be whatever you want. However, be aware of your recipients and if they require PTR or RDNS (additional email security), and configure this accordingly. You typically won’t have problems if you make this address something different than that of your recipients, but otherwise this can be completely faked for the most part.
The Reply-to address should be an email address that already exists that you access frequently. However this can be faked as well if you do not want return emails.
Leave the default Character set as UTF-8.
That’s it! You have now configured Outgoing SMTP for your SharePoint Farm.
To configure Incoming as well is very similar. You will simply navigate to System Settings then Configure incoming e-mail settings in Central Administration. For Enable sites on this server to receive e-mail select Yes; for the E-mail server display address: use any domain that you have configured appropriate MX records for as you can see from below. (You will need to point an MX record for the domain you use at this server’s external IP address). All other settings can be left as default.
**To make multiple mail servers, you need to perform each step for each mail server. Then ensure that the outgoing e-mail, incoming e-mail, or both timer jobs are running on each mail server, (you only need the timer jobs for the services you are actually using). Some items, such as setting MX records, PTR and/or RDNS, are DNS related and outside the scope of this posting. However quick descriptions for these records can be found online and help for configuring these records is highly individualized and assistance can usually be found from your DNS provider.
Hope this helps! Thanks for reading!