When attempting to change the primary domain for an existing account from either the WHM >> Account Functions >> Modify An Account interface or using the whmapi1 modifyacct API call, you will see the following error: (We use the API call here for demonstration)
whmapi1 modifyacct user=mytestcp DNS=domainnew.tld
reason: "List name “TEST” is not normalized or was invalid at /usr/local/cpanel/Cpanel/Mailman/NameUtils.pm line 69.\n"
Note: Here is a link to the above API call:
However, when checking to confirm whether the primary domain has been changed, you will observe that, despite the above error, the new domain appears as the new primary domain of the account:
whmapi1 listaccts | grep -Ei "(user|domain)"
This is caused if there is anything other than a directory (regular file, symlink and etc) in Mailman's mailing list directory located here:
You can confirm this by running the following command: (If there is any output to this command, it means a non-directory file exists)
find /usr/local/cpanel/3rdparty/mailman/lists -maxdepth 1 -type f
As you can see the file
TEST listed above is not a directory.
We've opened an internal case for our development team to investigate this further. For reference, the case number is CPANEL-36264. Follow this article to receive an email notification when a solution is published in the product.
In the meantime, it is possible to get around this issue by simply removing the file from Mailman's mailing list directory.