banner



How To Configure Mail Server In Windows Server 2008 R2

Send Email Directly on TFS

Estimated reading time: half-dozen minutes

My SMTP mail server requires that email be sent with TLS encryption and on port 587. This makes it problematic for Squad Foundation Server (TFS) to ship emails directly. To work around the problem, I installed the Windows 2008 SMTP Server service and configured it for relaying to my existent SMTP postal service server.

Contents

  • Install SMTP Server
  • Configuring the SMTP Service to Motorcar-Outset
  • Configuring the SMTP Service for Routing to Alternate SMTP Server
  • Internet Information Services (IIS) Managing director (IIS 7.0)
  • Internet Information Services (IIS) 6.0 Manager
  • Command Line
    • Desire More?

Install SMTP Server

To begin, launch Server Manager and add the SMTP Server characteristic.

image

This includes a dialog to add some additional items.

image

Click Add together Required Features and, later the dialog closes, click Next > followed past Install.

The same can be done from the command line using:

ServerManagerCmd –Install SMTP-Server            

Configuring the SMTP Service to Automobile-Starting time

Unfortunately, the service is not configured to auto-beginning past default so you need to go into the services to change this:

image

To perform the same action from the command line use the following PowerShell commands:

Become-Service SMTPSvc | Ready-Service –StartupType Automatic

From DOS you could use sc.exe.

Configuring the SMTP Service for Routing to Alternate SMTP Server

Finally, y'all demand to configure the SMTP Server to redirect to an alternate SMTP server (assuming it is not sending email directly).  This involves settings in both IIS 7.0 and IIS half dozen.  Open Net Data Server (IIS 7.0) and select the server node

Internet Information Services (IIS) Manager (IIS 7.0)

  1. From inside Internet Information Services (IIS) Manager, browse to the server's SMTP Email characteristic and open up it.
    image
  2. Inside the SMTP Due east-mail windows, enter in the "send from" email address, the remote SMTP server DNS name (or IP address) and the remote server port.  In improver, select Specify credentials and enter the credentials required to connect to the remote SMTP server.
    image

To perform the same activity from the command line utilize the following commands (Powershell is optional):

appcmd.exe set up config /commit:WEBROOT /department:smtp /from:Inigo.S.Montoya@IntelliTechture.com              
/deliveryMethod:Network /network.port:587 /network.defaultCredentials:Fake
/network.host:smtp.intelliTechture.com /network.userName:Inigo.Due south.Montoya@intelliTechture.com
/network.password:***

Where appcmd.exe is located in %windir%\System32\inetsrv\appcmd.exe.

Net Information Services (IIS) six.0 Managing director

  1. Launch Internet Data Services (IIS) 6.0 Director locate the [SMTP Virtual Server #] node and open up the Properties dialog.
    image
    As shows, I just added 127.0.0.1 so that I was only enabling the current box to transport via this SMTP Server only you lot tin also add a group of computers past subnet or an entire domain.
  2. Next, navigate to the Commitment tab and modify the settings for all three buttons, Outbound Security…, Outbound connections…, and Advanced….
    image
  3. For Outbound Security, switch to Basic Authentication and enter the remote SMTP Server credentials in addition to checking TLS encryption.
    image
  4. On the Outbound Connections tab, switch the TCP port to 587 (or any port you need).
    image
  5. Finally, on the Advanced Commitment tab, identify the Smart host equally the DNS (or IP accost) of the remote SMTP server.
    image
    For the Fully-qualified domain proper name refers to the server y'all are configuring, the one the SMTP-Service is being configure on.

Unfortunately, I didn't come up with the control line for this particular action.  I did find two leads as to where there may be a control line solution, however:

  1. The start is the smtpsetup.exe plan (located in %windir%\system32\inetsrv).  This program takes an INF file with the configuration information.
  2. Secondly, the configuration information itself is stored in %windir%\System32\Inetsvr\Metabase.xml.

Even though figuring out the final control line seemed within achieve, I had no data as to how the password was encrypted and stored into the file and without much to go on, I decided to move on.

Control Line

Combining all the command lines together (except for the IIS 6.0 configuration) yields the following:

ServerManagerCmd –Install SMTP-Server  $SMTPService = Go-WmiObject win32_service -filter "name='SMTPSvc'"
$smtpservice.ChangeStartMode("Automatic")
Fix-Alias appcmd "$env:windirSystem32inetsrvappcmd.exe"
appcmd.exe fix config /commit:WEBROOT /section:smtp /from:Inigo.S.Montoya@IntelliTechture.com              
/deliveryMethod:Network /network.port:587 /network.defaultCredentials:Faux
/network.host:smtp.intelliTechture.com /network.userName:Inigo.S.Montoya@intelliTechture.com
/network.password:***

Note: If yous are forwarding to gmail's SMTP server, here are the settings you need:

SMTP Server: smtp.gmail.com

SMTP Port: 587

TLS encryption: Checked

Want More than?

Curious almost what else you can do with Windows? Check out AAD: How to Clone/Copy a Local Windows 10 Account to an Azure Agile Directory Business relationship!

Source: https://intellitect.com/blog/configuring-windows-smtp-server-on-windows-2008-for-relay/

Posted by: samuelsmoseloway.blogspot.com

0 Response to "How To Configure Mail Server In Windows Server 2008 R2"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel