Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Operation Sheet 4.

1 Setup and Configure SMTP Email


Server on Windows Server 2012

Objectives:

 Install Email Services in Windows 2012 Server


 Configure SMTP Server Services
 Test SMTP Services Services

Procedure: The operation sheet is divided into three (3) main activities:

1. Installing SMTP Server


2. Configuring Email Server
3. Testing your Email Server

Part I: Installing the SMTP feature


1. Click on the Server Manager icon in the bottom left-hand corner to load the Server
Manager Dashboard:

Alternatively, click on the Powershell icon to its right and enter servermanager.exe at the
prompt to load the Server Manager Dashboard:

PS C:\Users\Admin> servermanager.exe
2. When the Server Manager Dashboard loads, click on Add roles and features in the center
pane as highlighted below:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 1


The Add Roles and Features Wizard will load, click Next to go past the initial Before You
Begin Page:

3. In the Installation Type section, select Role-based or feature-based installation and


click Next:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 2


4. In the Server Selection section, select your server, in my example below, my server is
called 2012, then click Next to proceed:

5. In the Server Roles section select Web Server (IIS) as highlighted below and click Next:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 3


Doing so will initiate a prompt to install the required IIS Management Console. Ensure you
check the Include management tools (if applicable) box per the below and click Add
Features to proceed:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 4


6. In the Features section, select the SMTP Server feature then click Install to proceed:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 5


You will prompted to install services and features required by the SMTP Server. Ensure you
check the Include management tools (if applicable) box per the below and click Add
Features to proceed:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 6


7. You will now be presented with the Web Server Role (IIS) section. Click Next to proceed:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 7


In the Role Services section, scroll down and under Management Tools select the services to
match those checked in screenshot below then click Next to proceed:

8. The Confirmation section will show all the role and feature configuration options you
previously selected:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 8


Click Install to start the installation:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 9


The installation should complete shortly. You nay need to reboot your server to fully complete
the installation.

Part II: Configuring the SMTP Server

The next step is to configure SMTP. To do so we will need to open Internet Information
Services (IIS) Manager 6. 10. Click on the Server Manager icon per step 1 to load the Server
Manager Dashboard. Then click Tools and then click on Internet Information Services (IIS)
6.0 Manager to load IIS Manager 6:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 10


9. In IIS 6 Manager, expand the server name, in my example below it is 2012, then right-click
on SMTP Server and select Properties:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 11


10. In the General tab, unless you want the SMTP Server to use a specific IP address, leave the
settings as they are so that the IP address is set to (All Unassigned):

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 12


11. To proceed, click on the Access tab:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 13


12. Click on the Authentication button and ensure Anonymous access is checked and then
click OK:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 14


13. Once back in the Access tab, click on the Connection button. Select Only the list below and
then click Add. Enter 127.0.0.1 as the IP address and then click OK:

The Connection setting controls which computers can connect to the SMTP server and send
mail. By granting only localhost (127.0.0.1) access, limits only the server itself the ability to

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 15


connect to the SMTP server. This is a requirement for security. Click OK to return
to the Access tab and then click on the Relay button. Enter 127.0.0.1 as the IP address and then
click OK:

The Relay section determines which computers can relay mail through this SMTP server.
By only allowing the localhost IP address (127.0.0.1) relay permissions it means that only the
server itself can relay mail. Conversely, it prevents the SMTP server from being an open
relay and being used to send unsolicited spam email by other computers on the internet, which
could lead to the SMTP server being blacklisted.

14. Next, go to the Messages tab. Here you can enter an email address where copies of non-
delivery reports are sent to. You can also configure the location of the Badmail director,
however, the default setting should suffice:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 16


15. Next, go to the Delivery tab:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 17


16. Click on the Outbound Security button and ensure Anonymous access is selected. As the
only server that can connect and relay mail through the SMTP server is localhost this security
settings is fine:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 18


17. Click OK to return to the Delivery tab and then click on Outbound Connections. Leave the
defaults as they are:

18. Click OK to return to the Delivery tab and then click on Outbound Connections, then click
on the Advanced button:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 19


Here you will need to enter the fully-qualified domain name of the SMTP server. This will be the
host name or A record that has been created in your DNS zone file. This is straight-forward to do
but you will have to confirm how you do this with the party that manages DNS for your domain.
I have entered mail.vsysad.com as this is fully-qualified. If you click on the Check DNS button
you can confirm whether your chosen name resolves successfully. In my case it does as I see the
following:

19. Click OK and then OK again to exit the SMTP Virtual Server Properties. You can also
perform this test by running nslookup to confirm the existence of the host name as well as
confirming the IP address it resolves to – which should the IP address of your server:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 20


Step 20. SMTPSVC Automatic Start up
Now you only have to configure the automatic startup of your SMTP server. You can do it
quickly using PoSh command prompt:

set-service smtpsvc -StartupType Automatic

Start the service:

start-service smtpsvc

Make sure that SMTPSVC is running:

get-service smtpsvc

Status Name DisplayName


—— —- ————
Running smtpsvc Simple Mail Transfer Protocol (SMTP)

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 21


SMTP Server Testing
The last thing you have to do is to make sure that your SMTP server is working. It is easier to do
it by creating a plain-text file smtp-test-email.txt on your desktop and copying the following
text to it. Don’t forget to change the sender and recipient names to yours.

From: server@localdomain.com

To: admin@localdomain.com

Subject: Email test

This is the test email

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 22


Copy smtp-test-email.txt to C:\inetpub\mailroot\Pickup. SMTP server monitors new files
appearing in this folder, and if a file is found it will read it and try to send an e-mail with the
given subject and body to the recipient specified in the To: line.
Check the recipient mailbox, and you will see this e-mail.

Step 21. Testing in PowerShell:

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 23


Send-MailMessage -SMTPServer localhost -To manager@localdomain.com -From server@localdomain.com -
Subject "Email test" -Body " This is the test email from PowerShell"

Operation Sheet4.1 – Email Server Dr. Patrick Cerna Page 24

You might also like