Azure VM as SMTP Relay

Steven Couture 66 Reputation points
2022-06-01T19:17:38.757+00:00

Does Microsoft support using an Azure VM as an SMTP Relay server? For example, an on-premises application that does not support sending authenticated emails sending the emails to an Azure VM/Mail relay server, which then passes the email to a 3rd party provider (SendGrid, Mailchimp, etc.) as authenticated?

If the emails are sent over TLS (587) would Microsoft throttle or block the traffic?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,044 questions
{count} vote

Accepted answer
  1. Cédric Perion 171 Reputation points
    2022-06-04T03:02:52.16+00:00

    Hi @Steven Couture ,

    Configure an SMTP in Azure like this :

    http://woshub.com/how-to-install-and-configure-smtp-server-on-windows-server-2012-r2/

    Will work.

    Don’t forget to open port 25 or 587 if you use NSG or firewall.

    What is important when you want to do mass mailing is configuration of dkim, spf ….

    You can use Exchange online mailbox too with smtp server.

    Hope it helps.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Andreas Baumgarten 123.7K Reputation points MVP Volunteer Moderator
    2022-06-01T20:37:40.567+00:00

    Hi @Steven Couture ,

    VMs running a SMTP server is only available only in some Azure subscription types.

    Please take a look here:
    https://learn.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    1 person found this answer helpful.
    0 comments No comments

  2. David Malko 126 Reputation points
    2022-11-10T21:24:48.773+00:00

    We found that doing the following worked, and can now edit the settings in the II6 Manager without errors (and without crashing when applying settings) every time:

    1. Stop SMTPSVC service [Display Name: Simple Mail Transfer Protocol (SMTP)]
    2. Stop IISADMIN service [Display name: IIS Admin Service]
    3. Edit "C:\Windows\System32\inetsrv\MetaBase.xml"
    4. Find: <IIsSmtpServer Location ="/LM/SmtpSvc/1"
    5. Add (Settings are alphabetical): RelayIpList=""
    6. Save file
    7. Start IISAdmin Service
    8. Start SMTPSVC service

    You can now open the Internet Information Services (IIS) 6.0 Manager (InetMgr6.exe) and work like normal. The setting above relates to the Access Tab > Relay Restrictions section, but doesn't set anything in it (i.e. "all except the below list" with a blank list).

    After setting this value you can change it to what you need it to be. (i.e. the value doesn't need to be 'null' for the fix to work, just so long as the variable is present in the file).

    The above has been tested on a few new installs of Windows Server 2022, and has worked for us every time. If you have done an upgrade there are some other things to consider (seems like the SMTP service is not installed after upgrade so will require a backup of the settings that can be applied post reinstalling the service. But that is discussed in other topics).

    PS: Remember to set the SMTPSVC service to start "automatically". By default its set to "manual".

    Source: https://serverfault.com/questions/1088555/server-2022-smtp-server-issue

    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.