Sometime you will get the following error message while trying to delete an email account from your cpanel.
=================================================
The e-mail address postmaster@domain.com deleted successfully.
Sorry, you do not have access to the domain domain.com
=================================================
This mainly occur in two cases.
1. when one domain is changed from add-on domain to main domain or vice-versa.
2. Domain is moved to another users account.
In this case you need to remove the email account from the existing account.
Steps:-
1. Remove the entries from the following files.
/home/user/etc/domainname.tld/passwd
/home/user/etc/domainname.tld/shadow
/home/user/.cpanel/email_accounts.yaml
2. Remove the directory
/home/user/mail/domain.com
Where ‘user’ is the account where the email address of ‘domain.com’ exist.