Skip to main content

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

Comments

5 comments

  • cPanelMichael
    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:
    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.
    0
  • jndawson
    Check to see if the entries for those aliases exist in the userdata directory associated with each account:
    /var/cpanel/userdata/$username/

    Nope, not there. You can search the files in those directories for aliases with a command such as this:
    grep serveralias /var/cpanel/userdata/$username/*

    Yep. Here's a sample of a simple entry:
    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:
    [ 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
    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/
    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?
    0
  • cPanelMichael
    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:
    /scripts/rebuildhttpdconf
    Thank you.
    0
  • jndawson
    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.
    0
  • jndawson
    More follow up: We were still seeing the sporadic cpanel.* or webmail.* entries in various accounts' zone editors. In the middle of doing something else, we were looking at account files in /var/cpanel/users and noted many accounts had these entries:
    DNS=domain.tld DNS2=cpanel.* DNS3=webmail.*
    We removed them using a script and ran /scripts/updateuserdomains. Hopefully, that finally fixes it. Still no clue how those entries showed up in the first place.
    0

Please sign in to leave a comment.