"Ghost" email accounts after deleting Add on domain

Sausages

Registered
Mar 1, 2009
4
0
51
I've moved an add on domain out to it's own account on the server and recreated the mailboxes, but on the previous account there are still mailbox entries for the add on domain which cannot be deleted.

The error returned is "Account does not exist". The mailbox usage shows there are still messages in the mailboxes but it isn't important to access these.

How can I delete these ghost email accounts?
 

JawadArshad

Well-Known Member
PartnerNOC
Apr 8, 2008
459
6
68
PK
cPanel Access Level
DataCenter Provider
I've moved an add on domain out to it's own account on the server and recreated the mailboxes, but on the previous account there are still mailbox entries for the add on domain which cannot be deleted.

The error returned is "Account does not exist". The mailbox usage shows there are still messages in the mailboxes but it isn't important to access these.

How can I delete these ghost email accounts?
Try to delete the folders 'domain.com' from original account's mail and etc folder where domain.com was setup as an addon.
 

Sausages

Registered
Mar 1, 2009
4
0
51
Thanks, I've done that but the entries within cPanel are still there.


I'm really only doing this as a matter of tidying up the accounts, I don't think I have any mail delivery issues.
 

JawadArshad

Well-Known Member
PartnerNOC
Apr 8, 2008
459
6
68
PK
cPanel Access Level
DataCenter Provider
Thanks, I've done that but the entries within cPanel are still there.


I'm really only doing this as a matter of tidying up the accounts, I don't think I have any mail delivery issues.
Logout of cPanel, backup the file 'email_accounts.yaml' and empty 'email_accounts.cache' in /home/user/.cpanel/ and try to log in to cPanel again.
 
  • Like
Reactions: sneader

Sausages

Registered
Mar 1, 2009
4
0
51
I've now tried that but still no change. Did you want me to empty email_accounts.yaml also?
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
I've now tried that but still no change. Did you want me to empty email_accounts.yaml also?
As was suggested by JPC-Howard, please retain a backup copy. With the cache file emptied or renamed/moved out of the way, next, rename the original YAML file, then access cPanel and refresh the E-mail Accounts page; the YAML file should be regenerated.

Here is is an example of how to rename the YAML file via SSH access; replace "username" with your cPanel account username:
Code:
# cd ~username/.cpanel
# mv -v email_accounts.yaml email_accounts.yaml.backup
 
Last edited:
  • Like
Reactions: sneader

Sausages

Registered
Mar 1, 2009
4
0
51
Thanks JPC-Howard and cPanelDon, that's resolved it. I had made a backup of the YAML file (I learned that a long time ago!) and it's now removed the rogue entries from cPanel.