Symptoms
While attempting to access the webmail interface, you may see an error like the following.
Template::Exception:
[TYPE]=[undef]
[INFO]=[You do not have a user named "emailuser@domain.tld". at /usr/local/cpanel/Cpanel/API.pm line 261.
]
[TEXT]=[]
at cpanel.pl line 1126.
cpanel::cpanel::cptt_exectag("/usr/local/cpanel/base/frontend/paper_lantern/mail/webmailfor"..., 1) called at cpanel.pl line 4606
cpanel::cpanel::run_standard_mode() called at cpanel.pl line 930
cpanel::cpanel::script("cpanel::cpanel", "./frontend/paper_lantern/mail/webmailform.html.tt") called at cpanel.pl line 326
Description
This can be caused by the mailbox for the email account having incorrect permissions or being missing.
Workaround
The mailbox will be located in the account's home directory at the following, where, DOMAIN.TLD is the domain the email address is under, and EMAILUSER is the part of the email address before the @ symbol.
mail/DOMAIN.TLD/EMAILUSER
The permissions should be 751 (rwxr-x--x). If it is not, the following articles cover fixing the permissions.
How to Fix Mailbox Permissions in WHM
How to Fix Mailbox Permissions via Command-Line
If the mailbox is missing, it will need to be recreated. The commands below will recreate the mailbox, where EMAILUSER is the part of the email address before the @ symbol, and ACCOUNT is the cPanel account username. /home in the first command may need to be changed if the cPanel account resides in a different home directory.
cd /home/ACCOUNT/mail/
mkdir EMAILUSER
chown ACCOUNT.ACCOUNT EMAILUSER
chmod 751 EMAILUSER
/scripts/mailperm ACCOUNT