Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

delete unused email accounts

Discussion in 'E-mail Discussion' started by dzamanakos, Feb 21, 2018.

  1. dzamanakos

    dzamanakos Active Member

    Joined:
    Feb 15, 2014
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi, when someone deletes an email account for example EMAIL@domain.com, the mailbox still remains with it's files under /home/user/mail/domain.com/EMAIL

    Is there a way to get a list of mailboxes that do not have an email account, in order to delete the files?

    best regards,
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    This should not happen. Can you try creating and deleting a test email account and verify if this behavior still occurs? If so, what do you see in /usr/local/cpanel/logs/error_log when deleting the email account?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. dzamanakos

    dzamanakos Active Member

    Joined:
    Feb 15, 2014
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Sorry, my mistake, i wanted to say that when deleting an addon-domain / alias, the email accounts are remaining as mailboxes.

    Is there a way to find these mailboxes in order to delete them?
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    That's correct. When you remove the addon domain or alias, its email accounts will no longer appear in the cPanel interface. However, the contents for this email account still exist in the home/username/mail directory. The "Email Disk Usage" option is the easiest way to delete the leftover emails:

    Email Disk Usage - Version 70 Documentation - cPanel Documentation

    There's no feature that will show you a list of all email data that exists for domain names that were previously deleted from an account. I encourage you to open a feature request for that at:

    Submit A Feature Request

    In the meantime, you could develop a custom bash script that scans for domain names in the /home/$username/mail directories, and then removes the directories if they do not match an active domain name associated with the account.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice