Guides, Articles and Frequently Asked Questions

  Index | Installation

How do I set up Exchange (2003 - 2016) to accept incoming messages only from the EuropeanMX servers?

Exchange 2003

With Microsoft Exchange 2003 it is possible to share the IP addresses responsible for delivery based on a host name. In Exchange 2003 there is a list of "domains" for this purpose, in which the host name "" can be entered instead of the root host name of your server.

Exchange 2007 - 2017

Since Microsoft has removed the ability to share incoming connections by hostname or via reverse DNS, a powershell script can help to automatically add the IP addresses to the whitelist of your Exchange Receive Connector.

Please note, however, that this script was originally developed for Exchange 2010 on Windows 2008 Small Business, but should also be compatible with other versions of Exchange and Windows Server.

Add-PSSnapin Microsoft.Exchange*


$ErrorActionPreference = "Stop"

$ips = [System.Net.Dns]::GetHostAddresses("") | select IPAddressToString

$ips = $ips | foreach-object {$_.IPAddressToString}

Set-ReceiveConnector -Identity "Default SERVERNAME" -RemoteIPRanges $ips


Replace the placeholder "SERVERNAME" with the name of your configured receive connector. You can find this under Exchange Management Console -> Server Name -> Server Configuration - > Hub Transport.

With this script, all IP addresses for the hostname "" are automatically read and added to the whitelist of your receiving connector. You can use a task planer to perform an automated, regular query of the IP addresses. You can do this with the following command:

powershell -command "& 'C:\psscripts\exchangereceiveconnector.ps1' "

If you are using Exchange 2007 with SBS 2008, you must run the task with the following command:

PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.Psc1" -Command ". C:\psscripts\exchangereceiveconnector.ps1

The user performing the task must be a member of the Microsoft Exchange Security Groups\Server Management group and must have the Log on as batch job permission.

If you have problems with the Powershell script, please contact us.

Optionally you can add more custom IP addresses, which you can add after the line containing "foreach-object":

$ips += ""

Make sure that you replace this IP with all IP addresses or subnets that should also have the permission to deliver directly. You can add this line for each IP/subnet you want to include.

Was this article helpful?

We use cookies for the technical functionality of this website. With your consent, we also collect page views and other statistical data in anonymized form.

Accept all cookies Select individually
Cookie Settings
Read Privacy Statement