IIS as SMTP Relay

Configure Windows Server 2012 SMTP Relay

Go in Server Manager to Tools > Internet Information Services (IIS) 6.0 Manager > Right-click [SMTP Virtual Server #1] > Click ”Properties” .

Click ”Access” tab > Click Connection > Check ”All except the list below” > OK > Click Relay > Check ”All except the list below” > OK.

Click ”Delivery” tab > Click ”Outbound Security” > Check ”Basic Authentication” > Type username and password of Office 365 user > Click ”TLS encryption” > OK >
Click ”Outbound connections” > Change ”TCP port” to 587 > OK > Click ”Advanced” > Fill in ”Smart host” with the name of the Office 365 SMTP server > OK > OK.

Check firewall rules – ”Simple Mail Transfer Protocoll (SMTP-In)”

Warning! You have an open relay now. Use this setup to check the email notification system. When you see it´s fully functional go back to the ”Access” tab and narrow down the ”Connection” and ”Relay” settings to the necessary systems. When no other system needs to relay, just check ”Only the list below” and grant ”127.0.0.1ÔÇ│ access.

365

365 Settings!
POP-inställning
Server name: outlook.office365.com
Port: 995
Encryption method: SSL

IMAP-inställning
Server name: outlook.office365.com
Port: 993
Encryption method: SSL

SMTP-inställning
Server name: smtp.office365.com
Port: 587
Encryption method: TLS

Find service start/run accounts

A powershell script that finds all services , filters som out depsending on start account…

$host_name = ”.”
# Addera här de tjänstekonton man vill filtrera bort
$accounts = ”NT Authority\\LocalService”,”NT AUTHORITY\\NetworkService”,”LocalSystem”
$Accountsfilter=”Select * from Win32_Service WHERE ”+ (($accounts | foreach-object { ”NOT StartName=’$_'” }) -join ’ AND ’)
Get-WmiObject -query $Accountsfilter | ft Name, DisplayName,Startmode,StartName