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

shankar431 471 Reputation points
2021-07-26T14:24:50.85+00:00

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@jaswant .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

Operations Manager
Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
1,482 questions
0 comments No comments
{count} votes

Accepted answer
  1. AlexZhu-MSFT 5,871 Reputation points Microsoft Vendor
    2021-07-27T00:39:56.097+00:00

    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 additional answer

Sort by: Most helpful
  1. AlexZhu-MSFT 5,871 Reputation points Microsoft Vendor
    2021-07-27T01:47:19.09+00:00

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.