The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

deleting 1000's of emails

Discussion in 'E-mail Discussions' started by cdnmama, May 30, 2008.

  1. cdnmama

    cdnmama Member

    Joined:
    Apr 28, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello....I just took over as webmaster for a new client's website. The cpanel for her account is Version 11.23.1-RELEASE. Her default email address has over 8000 emails in it, dating back 4 years. She does not use her domain for any email addresses. How would I go about deleting all these emails easily and quickly?

    Thanks for any help....Deb
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. cdnmama

    cdnmama Member

    Joined:
    Apr 28, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I should clarify that I don't have root access to the server but CMM does look good. My client is hosted on her friend's reseller hosting account. I've asked this friend to contact her webhost to see if they will empty this email account of all those emails. Hopefully that will work!
     
  4. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi Deb,

    You may contact your host & let them know the exact email account that is needed to be emptied. It's simpler from the SSH by removing all the files from the following folders : /home/username/mail/account/new
    /home/username/mail/account/cur

    Or you have to list & delete all the messages from webmail through Squirrelmail or Horde.. which can be a tedious job..
     
  5. cdnmama

    cdnmama Member

    Joined:
    Apr 28, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Thanks to everyone who replied. I asked the reseller to contact her host support but she must have deleted them on her own with horde or squirrelmail. I know I wasn't going to be the one to delete them all....as viraj said....a tedious job! :eek:
     
  6. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    The other option would have been uploading and running something like:

    PHP:
    <?php exec("find ../mail/domain.com -mtime +30 -type f | xargs rm -f"); ?>
    That'll remove all mail files over a month old. You could change the domain.com path in the above into domain.com/new or domain.com/mailaccount to make it more precise.
     
  7. cdnmama

    cdnmama Member

    Joined:
    Apr 28, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    what exactly do you do with this code?
     
  8. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    To delete the mail for the default box log in via FTP and change into the mail directory.

    Delete the folders new, cur, and tmp. These are all folders that pertain to your default address.

    You will also want to be sure that you log into the account's control panel and set the default address to discard messages. Setting the default address to discard messages will not delete the messages that are already in the default address mail folder.

    Consequently for regular mail account (i.e. not the default address) if you just remove the mail account through the control panel interface, then it will also delete the mail that is stored on the server for that mail account.

    However I take it from your message that since the domain is not being used for any e-mail, then there should not be any mail accounts set up and as a result all of the mail has been collecting in the default address. You want to be sure that the default address is set to discard messages and delete the three folders that were described above.
     
  9. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    This won't be possible because PHP's exec function is & should be disabled for security reasons..
    I don't think it's wise to leave such a dangerous function enabled.. this can be checked from the phpinfo()'s disable_functions. Best Luck.. ;)
     
  10. cdnmama

    cdnmama Member

    Joined:
    Apr 28, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Thanks sparek-3....very helpful info in case I run into this problem again. Now I'll know how to do it quickly and easily and not have to contact support for it.

    It was the default address and I set it to :fail: yesterday so no more mails to delete :)

    thanks again!

    Deb
     
Loading...

Share This Page