It appears a bug was added the IIS SMTP Server in Windows Server 2022. After installing the SMTP Server feature, you are not able to open the properties window in Internet Information Services (IIS) 6.0 Manager with MMC (Microsoft Management Console) displaying an error.

This is because the setting for RelayIpList in MetaBase.xml is incorrect . Since the SMTP Server hasn’t been significantly changed since Windows Server 2003 – it runs in IIS 6.0 Compatibility Mode after all – how this bug got introduced is a mystery. And Microsoft has taken no steps to fix it. Fortunately, this problem is easily corrected.

IIS 6.0 Compatibility Mode

In Windows Server 2003 and earlier, all things IIS used an internal database called the MetaBase for their configuration settings. In Windows Server 2008, Microsoft rewrote IIS to use the .NET Framework, which abandoned the MetaBase in favor of distributed XML configuration files. Realizing that there may be websites or extensions that could not make the jump to .NET. they added IIS 6.0 Compatibility Mode for those things that still needed to use the MetaBase.

During the redesign of IIS, Microsoft decided not to rewrite the SMTP Server to use the .NET Framework. This feature is basically unchanged since it was introduced with IIS for Windows NT Server, so Microsoft left the SMTP Server running under IIS 6.0 Compatibility Mode, and therefore, it uses the MetaBase. The reason that Microsoft hasn’t killed off the SMTP Server is because it’s a smart relay. That is, it can look up MX records in DNS to find the correct remote mail server to which an email should be delivered. This allows it to be used by IIS websites on the local server (or another server in the same solution) to relay outbound emails. While it’s not going away anytime soon, Microsoft isn’t do much to maintain it either.

Editing the MetaBase

The MetaBase configuration settings use an XML file in the C:\Windows\System32\inetsrv directory: MetaBase.xml. Microsoft created a VBScript program – adsutil.vbs – to allow MetaBase settings to be modified without editing the file. This script is installed if feature option IIS 6 Scripting Tools is selected when the SMTP Server is installed and is placed in the directory C:\inetpub\AdminScripts. Not all MetaBase settings can be managed by this script. If a setting uses a very long string, then adsutil.vbs isn’t able to handle it. RelayIpList is such a setting. Thus, we must directly edit MetaBase.xml.

MetaBase.xml cannot be edited while service IIS Admin Service is running. And since the SMTP Server is dependent on this service, both services must be stopped.

WARNING: Although IIS web and FTP services have been moved to .NET, the FTP Publishing Service (FTPSVC) and World Wide Web Publishing Service (W3SVC) services are also dependent on the IIS Admin Service (IISADMIN) service. Stopping IIS Admin Service will also stop the web and FTP services, bringing down all web and FTP sites.

Stopping and starting the IIS services that lock MetaBase.xml can be done using the iisreset command line utility. To stop IIS servers, open an elevated Command Prompt window (that is, use “Run as Administrator”) and run the following command:

C:\>iisreset /stop

Now you can edit MetaBase.xml. However, you may find your user account doesn’t have the appropriate permissions.

There is an easy workaround. From the same elevated Command Prompt window, open MetaBase.xml using Notepad. Since Notepad is launched from an elevated Command Prompt window, it also runs as administrator and has permissions to open MetaBase.xml.

notepad.exe C:\Windows\System32\inetsrv\MetaBase.xml

In Notepad, search for “RelayIpList”. These is only one entry for it in an unmodified MetaBase.xml file. On Windows Server 2022, this line is:

RelayIpList="530079007300740065006d0000000080010000004c00000000000000000000000100000001000000020000000200000004000000000000004c00008000000000000000000000000000000000ffffffff00000000"

The correct entry, which is what we find on Windows Server 2019, is:

RelayIpList="18000080200000803c00008044000080010000004c00000000000000000000000100000001000000020000000200000004000000000000004c00008000000000000000000000000000000000ffffffff00000000"

You can either replace the buggy entry with the correct entry or replace it with an empty string.

RelayIpList=""

Either works, but using the correct entry is preferred. After making the correction, save the changes and exit Notepad. Then use iisrest to start the IIS services.

C:\>iisreset /start

Now you can open the properties window for the SMTP Server.

Note that by default the SMTP Service startup is set to Manual. If the startup is not changed to Automatic, using iisreset to start the IIS Admin Service (and the other IIS services) will not start the SMTP Service. You will need to manually start the service.