Error to sending mail with Exchange 2019

Tistou 26 Reputation points
2022-11-24T16:10:25.713+00:00

Hi,

I've setup Exchange server 2019 in Azure cloud VM.

I can send mails in internal (to my domain).
I can receive mails from any domain (gmail.com for example)
But I can't send emails to other domains like gmail.
I get this error :
Failed to connect. Winsock error code: 10060, Win32 error code: 10060, Destination domain: gmail.com, Error Message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.125.200.27:25."

i created a rule in my vm conf to allow tcp smtp from anywhere (and every rules that's needed for exchange)
but when i try telnet "my ip" 25 it dont works ?
It can be from there ?

Thanks

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,577 questions
{count} votes

Accepted answer
  1. LilyLi2-MSFT 1,981 Reputation points
    2022-11-28T07:19:50.313+00:00

    Hi @Tistou ,

    Thanks for your reply.

    If you're using a non-enterprise subscription type, we recommend you use an authenticated SMTP relay services to send email from Azure VMs or from Azure App Service. Using these email delivery services isn't restricted in Azure, regardless of the subscription type. For example, SendGrid.

    For more information on how to use SendGrid as an SMTP relay to help you send emails, please refer to: how-to-send-email-from-exchange-server-vm-with-azure-azure-sendgrid-email-exchange-smtp-relay
    Please Note: Since these web sites are not hosted by Microsoft, the links may change without notice. Microsoft does not guarantee the accuracy of this information.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Philippe Levesque 5,711 Reputation points
    2022-11-24T17:46:27.227+00:00

    In an Azure VM you need an enterprise agrement to be able to send via the port 25 (outgooing). If for lab with an Enterprise agrement you need it approved by the wizard.

    Enterprise Agreement
    For VMs that are deployed in standard Enterprise Agreement subscriptions, the outbound SMTP connections on TCP port 25 will not be blocked. However, there is no guarantee that external domains will accept the incoming emails from the VMs. If your emails are rejected or filtered by the external domains, you should contact the email service providers of the external domains to resolve the problems. These problems are not covered by Azure support.

    For Enterprise Dev/Test subscriptions, port 25 is blocked by default. It is possible to have this block removed. To request to have the block removed, go to the Cannot send email (SMTP-Port 25) section of the Diagnose and Solve blade in the Azure Virtual Network resource in the Azure portal and run the diagnostic. This will exempt the qualified enterprise dev/test subscriptions automatically.

    After the subscription is exempted from this block and the VMs are stopped and restarted, all VMs in that subscription are exempted going forward. The exemption applies only to the subscription requested and only to VM traffic that is routed directly to the internet.

    All Other Subscription Types
    The Azure platform will block outbound SMTP connections on TCP port 25 for deployed VMs. This is to ensure better security for Microsoft partners and customers, protect Microsoft’s Azure platform, and conform to industry standards.

    If you're using a non-enterprise subscription type, we encourage you to use an authenticated SMTP relay service, as outlined earlier in this article.

    Ref: https://learn.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity

    1 person found this answer helpful.
    0 comments No comments

  2. Tistou 26 Reputation points
    2022-11-25T07:32:28.077+00:00

    Hi @Philippe Levesque
    Thanks for your reply,

    I changed the port with the command Set-SendConnector "Send-connector" -Port 587

    but always getting error :

    2022-11-25T07:23:46.032Z,Send-connector,08DACEB5DA69C0DB,2,,142.250.150.27:587,,,"Failed to connect. Winsock error code: 10060, Win32 error code: 10060, Destination domain: gmail.com, Error Message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 142.250.150.27:587."
    2022-11-25T07:23:46.032Z,Send-connector,08DACEB5DA69C0DE,0,,[2404:6800:4003:c00::1a]:587,
    ,SendRoutingHeaders,Set Session Permissions
    2022-11-25T07:23:46.032Z,Send-connector,08DACEB5DA69C0DE,1,,[2404:6800:4003:c00::1a]:587,,,attempting to connect
    2022-11-25T07:23:46.033Z,Send-connector,08DACEB5DA69C0DE,2,,[2404:6800:4003:c00::1a]:587,
    ,,"Failed to connect. Winsock error code: 10051, Win32 error code: 10051, Destination domain: gmail.com, Error Message: A socket operation was attempted to an unreachable network [2404:6800:4003:c00::1a]:587."

    I am in student subs

    thanks

    1 person found this answer helpful.