How to Reset Manual MX Configuration in cPanel/WHM

Overview

The /etc/manualmx file in cPanel/WHM is used to override the default MX routing for specific domains. If a domain is listed in this file, Exim will use the manually specified mail exchanger instead of the domain's normal mail routing configuration.

An incorrect entry in /etc/manualmx can cause mail delivery failures, including errors such as:

R=manualmx T=remote_smtp
all hosts for 'example.com' have been failing for a long time

or

Connection timed out
SMTP timeout after initial connection

Before Making Changes

Always create a backup before modifying the file:

cp -a /etc/manualmx /etc/manualmx.bak

To review the current manual MX entries:

cat /etc/manualmx

Option 1: Remove a Single Domain

If only one domain has an incorrect Manual MX entry, remove it without affecting other domains.

Example:

sed -i '/^example\.com:/d' /etc/manualmx

Rebuild the Exim configuration:

/usr/local/cpanel/scripts/buildeximconf
systemctl restart exim

Option 2: Reset All Manual MX Entries

If your server does not intentionally use Manual MX routing for any domain, you can clear the entire file.

cp -a /etc/manualmx /etc/manualmx.bak

> /etc/manualmx

Rebuild Exim:

/usr/local/cpanel/scripts/buildeximconf
/usr/local/cpanel/scripts/updateuserdomains
/usr/local/cpanel/scripts/mailperm

systemctl restart exim

Verify Mail Routing

Confirm that the affected domain is configured as a Local Mail Exchanger if mailboxes are hosted on the cPanel server.

Check:

grep example.com /etc/localdomains

The domain should appear in the output.

Also verify it is not listed as a remote domain:

grep example.com /etc/remotedomains

No output should be returned for locally hosted mail.


Verify the Manual MX File

Ensure the domain has been removed:

grep example.com /etc/manualmx

No output indicates the Manual MX override has been removed.


Test Exim Routing

Verify how Exim routes mail after the change:

exim -bt [email protected]

If the domain is configured correctly, Exim should route the message locally instead of using the manualmx router.


Important Notes

  • Only clear /etc/manualmx if none of your domains intentionally use an external mail provider such as Google Workspace, Microsoft 365, or Zoho Mail.

  • If some domains use external mail services, remove only the incorrect entries rather than clearing the entire file.

  • Always back up /etc/manualmx before making any modifications so the original configuration can be restored if necessary.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...

How to Secure a cPanel/WHM Web Server

Here are a few basic steps that you should keep in mind for keeping a server secure. 1) Strong...