Skip to main content

Delete old emails

Comments

9 comments

  • 24x7server
    Hi, If you want to perform this deletion activity through PHP, then you may end up enabling some PHP vulnerable function that is required to actually execute the removal command, in an attempt you may get in trouble with opening your server for attacks. Please be careful... A bash script would be perfect way for you to do this.. Hint: You can remove the mails from the "cur" folder that has the new and current emails..
    0
  • jnorris235
    Hi, If you want to perform this deletion activity through PHP, then you may end up enabling some PHP vulnerable function that is required to actually execute the removal command, in an attempt you may get in trouble with opening your server for attacks. Please be careful... >> That sounds like good advice - thank you. A bash script would be perfect way for you to do this. Hint: You can remove the mails from the "cur" folder that has the new and current emails..

    >> What do I actually do with a bash script - can it made to run automatically (via a cron job perhaps?)
    0
  • Infopro
    would somebody be kind enough to offer a php script?

    Not sure why you'd need a script for this when it can be done from in your cPanel easy enough. cPanel > Email > Email Accounts > choose an email account you'd like to clean up by clicking the More menu to the right of the email account listed here, then select Manage Disk Usage. Click Manage to the right for some options. Will this fit your needs? 46915
    0
  • jnorris235
    That is absolutely perfect, thought I'd investigated everything on cPanel, many google searches, then got bogged down with similar threads using more esoteric stuff. Very grateful for your time!
    0
  • Infopro
    Happy to help. :)
    0
  • vanessa9909
    Not sure why you'd need a script for this when it can be done from in your cPanel easy enough. cPanel > Email > Email Accounts > choose an email account you'd like to clean up by clicking the More menu to the right of the email account listed here, then select Manage Disk Usage. Click Manage to the right for some options. Will this fit your needs? 46915

    Hello I would like to know which command I can use to delete messages that are 6 months or older. And not from 1 year or more.
    0
  • cPanelMichael
    I would like to know which command I can use to delete messages that are 6 months or older. And not from 1 year or more.

    Hello, You can use the same option in cPanel: Email Disk Usage - Version 68 Documentation - cPanel Documentation Note the following under the "Remove Messages" section: Select custom query ... to customize your removal option. For more information, read Dovecot's
    0
  • birken
    i am using paper_lantern theme in cpanel and cant find any where to delete email form disk where is it please?
    0
  • cPanelMichael
    i am using paper_lantern theme in cpanel and cant find any where to delete email form disk where is it please?

    As a reseller, you will need to check with your hosting provider to verify the Email Disk Usage feature is enabled and available for use. It's documented at: Email Disk Usage - Version 68 Documentation - cPanel Documentation Thank you.
    0

Please sign in to leave a comment.