Requirements
Sureview requires the details of a real SMTP server in order to send email notifications to users such as automatic alerts when critical events have occurred on sites they belong to.
NOTE: if you do not wish to be able to send email alerts to Sureview users you can ignore this pre-requisite.
Location Options
The SMTP server may be either:
- your own corporate SMTP server which your IT team are responsible for. To use this you will need your IT team to provide:
- the IP address of your SMTP server
- a username and password that Sureview can use to authenticate when sending email
- network access for the Sureview servers to get to port 25 TCP on your SMTP server
- installed on the Sureview servers using the built-in Windows SMTP server to allow local services on each server to send emails
Guidance: Installing and configuring the Windows SMTP Service
To use the built-in Windows SMTP Service as a real SMTP server to allow services running on the server to send emails use the following PowerShell commands (this method works on a server regardless of having a GUI available - to use the Windows GUI refer to Microsoft documentation).
Install the Windows SMTP Feature
Run the following PowerShell command as an administrator to install the Windows SMTP feature and set it to start automatically on server boot (by default it is manually started):
Install-WindowsFeature -Name SMTP-Server, Web-WMI -IncludeManagementTools;
Set-Service -Name "SMTPSVC" -StartupType "Automatic";
Allowing relaying from the local machine
Run the following PowerShell command as an administrator to configure the SMTP Server to:
- allow relaying of emails from any services running on the local server
- listen on port 2525 so it doesn't conflict with the SureView SMTP Receiver used to receive SMTP alarms from integrated systems
$SmtpConfig = Get-WMIObject -Namespace root/MicrosoftIISv2 -Query "Select * From IisSmtpServerSetting";
$RelayIpList = @( 24, 0, 0, 128, 32, 0, 0, 128, 60, 0, 0, 128, 68, 0, 0, 128, 1, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 127, 0, 0, 1 );
$SmtpConfig.RelayIPList = $RelayIpList;
$Bindings = $SmtpConfig.ServerBindings;
foreach ($Binding in $Bindings) { $Binding.Port = "2525" };
$SmtpConfig.ServerBindings = $Bindings;
$SmtpConfig.Put();
Testing sending
To test that you can send real emails via the Windows SMTP service use the Send-MailMessage PowerShell command which can test all parts of SMTP including attachments and SSL. Basic example:
Send-MailMessage -SmtpServer yoursmtpserveraddress -Port 25 -To "youremail@yourdomain.com" -From "somename@somedomain.com" -Subject "Test Subject" -Body "Test Body"
Wait a few minutes and check your email - if everything is working correctly you should have received an email from the address you made up to your real email containing the content data you entered.
If you receive an error saying that "relaying is not permitted" then you need to do the configuration steps above to allow the SMTP Service to relay emails for connections coming from the local machine.
Comments
0 comments
Please sign in to leave a comment.