Skip to main content

How can I safely delete emails from forwarded accounts?

Comments

4 comments

  • 24x7server
    Hi, The command " rm -rf /home/username/mail/domainname.com/user*/cur/* " does looks to be fine to remove the mail on rotational basis.. If you are too worried about this, you can just initiate account backup in the beginning of the script, so it will take a backup and then remove it..
    0
  • Kent Brockman
    Great. I've tested it and works great. The key is to empty both folders: rm -rf /home/username/mail/thedomain.com/emailaccount/cur/* rm -rf /home/username/mail/thedomain.com/emailaccount/new/* Thanks!
    0
  • cPanelMichael
    Hello, I'm glad to see it's working as intended. I'm marking this thread as solved. Thank you.
    0
  • Kent Brockman
    Addendum: Yet the previous steps works. It's needed a final step to execute after every clean task: /scripts/generate_maildirsize --verbose --allaccounts --force --confirm username This will reset the cPanel stats of usage of every account, so that disk usage is correctly displayed. Best regards
    0

Please sign in to leave a comment.