cPanel. Solving the Failed to find user “” from expanded string

Once on the same server as cPanel, after changing the settings in the WHM menu “Server Configuration” – “Settings”, email stopped working, I found the following error in the logs:

(because /etc/aliases username: …???? Failed to find user “” from expanded string “${lookup{$domain}lsearch{/etc/userdomains}{$value}}” for the virtual_aliases_nostar router

Looking for the reason, I found that someone specified an alias for one of cPanel users in the /etc/aliases file, which is why after changing the settings in the WHM, this user name was not added to the /etc/userdomains file and others.
Probably someone wanted to forward the user’s mail immediately to another email, but cPanel did not like it:

username test@example.com

Therefore, I removed this alias:

cd /etc/
nano aliases
newaliases

And again I applied the settings in the WHM menu “Server Configuration” – “Settings”, after which the name of this user was added to the files and there were no more errors.

I note that the file /etc/userdomains is automatically generated after applying the settings in WHM and some system updates, there is no point in manually editing, usually its structure is this:

ixnfo.com: username
test.ixnfo.com: username

Leave a comment

Leave a Reply