Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Where does cPanel store a domain's mail routing selection (automatic/local/remote/backup)?

Discussion in 'E-mail Discussion' started by Valetia, Jan 21, 2015.

  1. Valetia

    Valetia Well-Known Member

    Joined:
    Jun 20, 2002
    Messages:
    213
    Likes Received:
    1
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    In which file(s) does cPanel store a domain's mail routing selection (automatic/local/remote/backup) as chosen by the user in cPanel?
     
  2. MilesWeb

    MilesWeb Well-Known Member
    PartnerNOC

    Joined:
    May 23, 2012
    Messages:
    173
    Likes Received:
    2
    Trophy Points:
    68
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    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 :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Valetia

    Valetia Well-Known Member

    Joined:
    Jun 20, 2002
    Messages:
    213
    Likes Received:
    1
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    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. :)
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    It's configured in the cPanel user file (e.g. /var/cpanel/users/$username). EX:

    Code:
    MXCHECK-testdomain01.com=secondary
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Valetia

    Valetia Well-Known Member

    Joined:
    Jun 20, 2002
    Messages:
    213
    Likes Received:
    1
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    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.
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Please notice the following warning when running this script:

    We don't generally advise running the "/scripts/checkalldomainsmxs" script. Is there some tutorial or guide that suggested using it?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice