Where does cPanel store a domain's mail routing selection (automatic/local/remote/backup)?
In which file(s) does cPanel store a domain's mail routing selection (automatic/local/remote/backup) as chosen by the user in cPanel?
-
]In which file(s) does cPanel store a domain's mail routing selection (automatic/local/remote/backup) as chosen by the user in cPanel?
With the automatic option it will detect where MX records point and will update it accordingly. /etc/backupmxhosts - backup /etc/localdomains - local /etc/remotedomains - remote Hope this helps :-)0 -
]/etc/backupmxhosts - backup /etc/localdomains - local /etc/remotedomains - remote
Yes, these are the final files generated by cPanel's mail routing processor, but we need to know where cPanel stores the user preference. For example, if a user sets the preference in cPanel to 'Local' (instead of 'Automatic', 'Remote' or 'Backup'), cPanel will need to store this user preference somewhere, while also updating the /etc/localdomains file. Then, the next time the user returns to cPanel, they will continue to see 'Local' selected, and not 'Automatic (Local)'. So, what we need to know is where cPanel stores this data. :)0 -
Hello :) It's configured in the cPanel user file (e.g. /var/cpanel/users/$username). EX: MXCHECK-testdomain01.com=secondary
Thank you.0 -
Thanks! We see the MXCHECK entries in /var/cpanel/users/$username. But, it looks like running /scripts/checkalldomainsmxs will remove all of those MXCHECK entries in /var/cpanel/users/$username! In other words, running that script will reset all domains on the server to 'Automatic', even if a user had selected something different. Is this intentional, or a bug? If it is a bug, please look into correcting the issue. On the other hand, if it is intentional, then please perform the following: 1. Add a warning message to /scripts/checkalldomainsmxs that it will reset all domains to 'Automatic', overriding cPanel users' preferences! 2. Add an optional argument (such as --preserve-user-settings) that allows it to preserve (and honor) the users' preferences. This also speeds up the processing for domains that have user selections. 0 -
Please notice the following warning when running this script: [~]# /scripts/checkalldomainsmxs This script will check each MX entry for every domain configured on this machine. The MX record will be determined from the zone file associated with this server, not from a remote query of the DNS record. If you are using and editing the zone file on a server not associated with this server through a DNS cluster configuration, then this utility will configure your email settings incorrectly. This utility updates the following files which alter the local delivery and sending methods of email: /etc/localdomains /etc/remotedomains /etc/secondarymx As a safety precaution you must run this utility with the argument "--yes" to proceed. example: /scripts/checkalldomainsmxs --yes
We don't generally advise running the "/scripts/checkalldomainsmxs" script. Is there some tutorial or guide that suggested using it? Thank you.0
Please sign in to leave a comment.
Comments
5 comments