Sometimes you need to automatically update the MX entries for all domains on the server. cPanel has the
/usr/local/cpanel/scripts/checkalldomainsmxs script that will attempt to determine if a domain's mail is supposed to be handled locally or remotely.
Before running this script, make a backup of these files:
After these files are backed up run this command:
Note: As this script affects all domains on the server, you must include the
--yes flag when you run the script.