question

shankar431-9012 avatar image
0 Votes"
shankar431-9012 asked shankar431-9012 commented

Getting “500 unrecognized command” when telnet to mail server from Windows Server 2019 in Azure

Hi All,

We are are getting the below alert in SCOM 2019 which is running on windows server 2019.

Alert name: Failed to send notification using server/device.

Alert Description:
Notification subsystem failed to send notification using device/server 'smtp-abc.server.com' over 'Smtp' protocol to 'email@abc.com'.

When we are trying to do telenet the SMTP server with the below steps from SCOM management server which is in Notification resource pool we are getting the below message.

118002-500-error.png

telnet abc.kpmg.com 25
helo
mail from: email@com
rcpt to: email@com
data
Subject: Test
Test.
.

Can any one please suggest how to know the SMTP servers avialabity/functionality working fine.

Regards,
Ravi shankar


msc-operations-manager
500-error.png (52.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AlexZhu-MSFT avatar image
0 Votes"
AlexZhu-MSFT answered shankar431-9012 commented

Hi,

When we configure mail notification in SCOM, the SCOM works as a mail agent, just as Outlook. And we may use Send-MailMessage to test if the Management Server can send mail before we configure the mail notification.

 $mailUser = <username>
 $mailPass = ConvertTo-SecureString <password> -AsPlainText -Force
    
 $mailCred = New-Object System.Management.Automation.PSCredential($mailUser, $mailPass)
    
 Send-MailMessage -To <recipient_address> -From <sender_address> -Subject "Test email - PowerShell 4.0" -Body "Hello World!" -SmtpServer <smtpserver> -Credential $mailCred

118026-scom-mail-notification.png

Alex
If the response is helpful, please click "Accept Answer" and upvote it.



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Alex ,

Thank you for providing the solution it worked for us.

Regards,
Ravi shankar

0 Votes 0 ·
AlexZhu-MSFT avatar image
0 Votes"
AlexZhu-MSFT answered AlexZhu-MSFT edited

Hi,

In the above sample output, line 1 indicates that after connecting to the SMTP server, the SMTP banner seems corrupt by displaying (***). The banner characters are replaced by asterisks. The reason for this is that a firewall or third party application in your environment is interfering or performing an inspection on the SMTP/ESMTP traffic. It may filter out or replace the SMTP traffic or the SMTP commands. This could be a firewall of router/proxy between the SCOM Management Server and the SMTP server, or even some email security software. To resolve this issue, you can change the attribute of port 25 in the firewall to not to monitor SMTP/ESMTP traffic, or modify the router/proxy firewall to disable any SMTP/ESMTP inspection. Alternatively, you can use a different port number for the SMTP Server, such as 587.

I've tried in different environment to reproduce the issue and here's screenshots for your reference. For our issue, we may seek help from network guy or Azure admin and test it again (either use telnet or Send-MailMessage mentioned above) after the re-configuration.

screenshot from environment without firewall
118049-telnet-working.png

screenshot from environment with firewall
118073-telnet-failed.png


Alex
If the response is helpful, please click "Accept Answer" and upvote it.




telnet-working.png (6.9 KiB)
telnet-failed.png (10.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.