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.

Delete ALL mail in main account

Discussion in 'E-mail Discussions' started by slinky, Aug 19, 2008.

  1. slinky

    slinky Well-Known Member

    Joined:
    Jul 26, 2007
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    As a result of massive spam, my primary account of a domain has had its mailbox flooded with over 500 MB of garbage. You'd say "simple - just delete the email account and start over." The problem is that it's not the email account but appears to be the primary account associated with the domain. Perhaps the catchall used to be enabled at one time. There unfortunately doesn't seem to be a button that says "purge mailbox" or allows you to delete all mail in the mailbox.

    Using Horde or Squirrelmail to login is useful even if it wouldn't time out. Trying to use Outlook Express was useless. Over 150,000 emails that would take over a day to download and were taxing my server. Even the emails I pulled down weren't deleted properly off the server.

    So I am hoping there is an easier way to clean out this primary account and purge all email in it without having to delete the domain and then recreate it and the entire web site and databases.

    Many thanks.
     
  2. MaestriaNick

    MaestriaNick Well-Known Member

    Joined:
    Aug 6, 2008
    Messages:
    159
    Likes Received:
    3
    Trophy Points:
    18
    You can delete it via ftp or via shell.

    The path to the main mail account is /home/USERNAME/mail
    if the mailbox format is mbox, empty the inbox file at /home/USERNAME/mail/inbox

    if it is in the Maildir format, the corresponding mail dirs are

    /home/USERNAME/mail/new and /home/USERNAME/mail/cur /home/USERNAME/mail/tmp . You will need to empty the /home/USERNAME/mail/cur and /home/USERNAME/mail/new folders.

    Also, set catchall to :fail: to bounce such mails to non existing accounts in future.
     
    #2 MaestriaNick, Aug 19, 2008
    Last edited: Aug 19, 2008
  3. slinky

    slinky Well-Known Member

    Joined:
    Jul 26, 2007
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Nick - thanks for your help. You posted the below info in another thread. I actually had to delete the cur and new directories and recreate them because I was being told that there were too many entries to list and can't remember the exact message. Now that they are empty, I'm still seeing a huge amount of mail in that main account. Is it possible that these deleted messages are still appearing somewhere? The tmp directory has one file in it (courier.lock) - I have noticed that I can login with squirrelmail so it appears that the data is definitely emptied although the tally is being kept somewhere.

    Thanks again... here are the commands that should help others:

    Code:
    ---------
    cd /home/user/mail/new
    rm -f *
    cd ../cur
    rm -f *
    ---------
     
  4. ArbuZz

    ArbuZz Active Member

    Joined:
    Mar 27, 2007
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    You can use the following command, when you get: Argument list too long message.


     
  5. Doug E

    Doug E Well-Known Member

    Joined:
    Aug 17, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    I cant use

    from within /home/user/mail/new because it says

    so I tried

    from within /home/user/mail/new but I get the reply

    What are some other options?
     
Loading...

Share This Page