Sometimes while trying to delete an email account from cPanel, you may encounter an error similar to the following:
The e-mail address postmaster@domain.com deleted successfully.
Sorry, you do not have access to the domain domain.com This issue with removing an email account from cPanel usually occurs because the domain ownership information inside cPanel is not properly updated after account or domain changes.
Although the email address may appear deleted, its entries and mail data can still remain on the server. In such situations, manual cleanup is required.
Common Causes of the Issue with Removing an Email Account from cPanel
This problem mainly occurs in the following cases:
1. Domain Changed Between Main and Addon Domain
The issue can happen when a domain is changed:
- From an addon domain to the main domain
- From the main domain to an addon domain
During this process, cPanel may retain old email account references.
2. Domain Moved to Another cPanel Account
If a domain is transferred from one cPanel account to another, the old account may still contain email account records associated with that domain.
As a result, cPanel may fail to remove the email account correctly.
How to Fix the Issue with Removing an Email Account from cPanel
To resolve this issue, you need to manually remove the remaining email account entries from the server.
Step 1: Remove Email Account Entries
Delete the related entries from the following files:
/home/user/etc/domainname.tld/passwd
/home/user/etc/domainname.tld/shadow
/home/user/.cpanel/email_accounts.yaml Notes
- Replace
userwith the actual cPanel username. - Replace
domainname.tldwith the affected domain name.
These files contain email authentication and account configuration information.
Step 2: Remove the Mail Directory
Delete the email account mail directory:
/home/user/mail/domain.com This removes the remaining mailbox files associated with the domain.
Important Precautions
Before making any changes:
- Take a backup of all configuration files
- Verify the correct cPanel username and domain
- Ensure the email account is no longer in use
- Double-check file paths before deletion
Incorrect modifications can affect other email accounts on the server.
Why This Happens in cPanel
cPanel stores email account details in multiple configuration files. When domains are migrated or ownership changes occur, these entries may not update properly.
This creates orphaned email account records that cause permission or access-related errors during deletion.
Manual cleanup helps synchronize the account information and fully remove the email account from the server.
Conclusion
The issue with removing an email account from cPanel is commonly related to domain ownership changes, addon domain modifications, or account migrations. Even though cPanel may partially delete the account, old configuration entries can remain behind.
By manually removing the entries from the passwd, shadow, and email configuration files, along with deleting the mail directory, you can completely resolve the issue and clean up the email account properly.
If you require help, contact SupportPRO Server Admin

