When logging into webmail via cPanel >> Email Accounts >> the Check Email button to the far right of an email account, an internal server error is displayed, and the following error is logged to the cPanel error log where $USER is the username of the email account and $DOMAIN.TLD is the domain name.
cpsrvd c8814797d5e3: Cpanel::Exception::UserNotFound/(XID c25adu) You do
not have a user named “$USER”.
at /usr/local/cpanel/Cpanel/AcctUtils/Lookup/MailUser.pm line 138.
called at /usr/local/cpanel/Cpanel/Security/Authn/Webmail.pm line 73
CPANEL_HIDDEN__, __CPANEL_HIDDEN__, __CPANEL_HIDDEN__) called at cpsrvd.pl
cpanel::cpsrvd::getpasswd_webmaild(__CPANEL_HIDDEN__) called at cpsrvd.pl
cpanel::cpsrvd::handle_form_login() called at cpsrvd.pl line 1324
cpanel::cpsrvd::handle_one_connection(12) called at cpsrvd.pl line 1116
cpanel::cpsrvd::script() called at cpsrvd.pl line 434
[2020-08-26 02:11:31 +0300] info [webmaild] Internal Server Error:
"POST /login/?login_only=1 HTTP/1.1" 500 Error ID c8814797d5e3
This occurs when the hostname of the server is set to the domain name associated with the email account. For example, if the email account is "firstname.lastname@example.org" and the hostname of the server is "domain.tld", you will receive an internal server error when logging into webmail via cPanel >> Email Accounts >> the Check Email button to the far right of an email account.
Change the hostname of the server to a fully qualified domain name. For example, server.example.tld or host.example.tld. Please see our article on Effective Hostname Usage With cPanel & WHM for more information.
Once the hostname is changed, you may need to run the following script to ensure the cPanel account and domain entries are added to /etc/userdomains: