Symptoms
After logging into your cPanel account, you notice that one or more email accounts are missing.
Description
When accessing the main Email Accounts interface, the email account list is either incomplete or empty.
Workaround
If the email account list is empty or missing users, and you are sure they exist, look at the /home/$user/etc/domain.tld/shadow
and /home/$user/etc/domain.tld/passwd
files. If you have backups of these files, you will want to restore them.
If there are no backups, edit the shadow
and passwd
files and copy one of the existing entries to recreate the entries for any missing email accounts. You may want to also consider modifying each of the new password hash by a few characters to avoid duplicating the password to each account.
After this has been done, if the email accounts still do not appear in the interface, move aside the email account's JSON file located in /home/$user/.cpanel/email_accounts.json:
mv /home/$user/.cpanel/email_accounts.json{,.backup}
Finally, reset the password for each of the users that were recreated. To do this from the cPanel interface, review this article:
How to reset your Email password through the cPanel interface
From the command line, review this article:
How To Reset Email User Passwords via the command line
If this continues to happen, the account is likely compromised. Restore the account from a clean backup or to clean the account. It's best to consult with a security administrator to ensure the site is fully cleaned. The following article may also be helpful: