The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

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

  1. Valetia

    Valetia Well-Known Member

    Joined:
    Jun 20, 2002
    Messages:
    207
    Likes Received:
    1
    Trophy Points:
    18
    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:
    174
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    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 :)
     
  3. Valetia

    Valetia Well-Known Member

    Joined:
    Jun 20, 2002
    Messages:
    207
    Likes Received:
    1
    Trophy Points:
    18
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. Valetia

    Valetia Well-Known Member

    Joined:
    Jun 20, 2002
    Messages:
    207
    Likes Received:
    1
    Trophy Points:
    18
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page