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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED cpanel.* and webmail.* subdomains assigned to every account

Discussion in 'General Discussion' started by jndawson, Aug 28, 2017.

  1. jndawson

    jndawson Well-Known Member

    Joined:
    Aug 27, 2014
    Messages:
    167
    Likes Received:
    18
    Trophy Points:
    18
    Location:
    Western US
    cPanel Access Level:
    DataCenter Provider
    This is a weird situation (yes, another one).

    We have a server that we absorbed from another hosting company. At some point in their past history, they assigned the aliases cpanel.* and webmail.* to each account.

    To be clear, the asterisk is NOT a wildcard - it's the actual entry. Every account (almost) has two aliases assigned (cpanel > domains > aliases). (see attached pic) cpanel_alias_issue.png

    Trying to delete the alias within cpanel results in:
    Code:
    There was a problem removing the alias. Park::unpark failed: You do not have control of the domain “cpanel.”. 
    Using whm > account information > list parked domains sometimes shows one account with the alias cpanel.*, webmail.* and sometimes whm.*. Those always have the 'add to mail config' link showing, as well. Removing the parked domain sometimes results in success, but always lists an account different from the one we're removing. It also has no affect on what shows up in the cpanel tools.

    One example (imagine a grid):

    Code:
    Primary Domain 
    customerdomain.tld
    
    User
    username
    
    Parked Domains
    cpanel.*
    customerdomain2.tld
    webmail.*
    
    Action
    Unpark   Add to Mail Config
    Unpark
    Unpark   Add to Mail Config
    
    Removing cpanel.*:
    Code:
    There was a problem unparking cpanel.* from : Show Details
    The system cannot determine the base domain for “cpanel.*” (i.e., the domain on which “cpanel.*” is parked).
    
    We've checked all the files that we can find that have anything to do with domains, subdomains, aliases, etc; if we find an entry, it's usually related to only one domain, and after getting that deleted in the related file, the alias remains and the other aliases are all still assigned to the other domains.

    updateuserdomains, fixvaliases do not correct the issue, nor does any other domain-related script.

    Where does whm/cpanel manage these relationships and how do we fix them?

    Centos 6.9
    WHM 66.0.15

    cpanel_alias_issue.png
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Check to see if the entries for those aliases exist in the userdata directory associated with each account:

    /var/cpanel/userdata/$username/

    You can search the files in those directories for aliases with a command such as this:

    Code:
    grep serveralias /var/cpanel/userdata/$username/*
    Or, if you don't see the entries there, see if you notice any local Apache template files in the following directories:

    /var/cpanel/templates/apache2_4/
    /var/cpanel/templates/apache2/

    Thank you.
     
  3. jndawson

    jndawson Well-Known Member

    Joined:
    Aug 27, 2014
    Messages:
    167
    Likes Received:
    18
    Trophy Points:
    18
    Location:
    Western US
    cPanel Access Level:
    DataCenter Provider
    Nope, not there.

    Yep. Here's a sample of a simple entry:
    Code:
    grep serveralias /var/cpanel/userdata/*/*|grep cpanel
    
    /var/cpanel/userdata/username/customerdomain.tld:serveralias: cpanel.* mail.customerdomain.tld webmail.* www.cpanel.* www.customerdomain.tld www.mail.customerdomain.tld www.webmail.* cpanel.* webmail.*
    
    
    We have many to deal with:

    Code:
    [ Tue Aug 29 10:03:29 ]
    [ root@cp3 userdata># grep serveralias /var/cpanel/userdata/*/*|grep cpanel|wc -l
    1542
    [ Tue Aug 29 10:04:54 ]
    [ root@cp3 userdata># grep serveralias /var/cpanel/userdata/*/*|grep webmail|wc -l
    1530
    
    Nope.

    So now the question is, is there an easy fix or do we need to write a script to remove those (not a big deal, actually)? What else do those files affect, and will we need to make other changes?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You'd need to manually remove those entries from the ServerAlias lines (e.g. cpanel.*, webmail.*). There's no script to do this automatically, so you'd need to develop a script to do so if necessary. The userdata files are used to populate the Apache configuration file, so remember to rebuild it after making the changes:

    Code:
    /scripts/rebuildhttpdconf
    Thank you.
     
  5. jndawson

    jndawson Well-Known Member

    Joined:
    Aug 27, 2014
    Messages:
    167
    Likes Received:
    18
    Trophy Points:
    18
    Location:
    Western US
    cPanel Access Level:
    DataCenter Provider
    Follow up:

    We ran a simple delete script to remove the cpanel.*, webmail.*, www.cpanel.*, www.webmail.* aliases from the userdata files, ran
    /scripts/rebuildhttpdconf, and it seems that did the trick.

    Side note: we had reached out to the former operators to see how they accomplished creating these aliases, but never got a response.
     
    cPanelMichael likes this.
Loading...

Share This Page