1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Easy way to delete 80000k emails?

Discussion in 'E-mail Discussions' started by razorhazor, Jan 10, 2005.

  1. razorhazor

    razorhazor New Member

    Joined:
    Feb 21, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    An old email account of mine gets thousands of SPAM emails a day and Its totalling 80,000k emails now!

    Is there a way I get purge all of them using cPanel or SSH????

    Thanks in advance
    Matt
     
  2. netarus

    netarus Member

    Joined:
    Oct 27, 2002
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Delete inbox mail

    I've had to do this in the past and I've found doing this is successful. Run it at your own risk.

    1) First, rename the 'inbox' file to back it up.

    mv /home/<username>/mail/<mydomain.com>/<login>/inbox /home/<username>/mail/<mydomain.com>/<login>/inbox.bak

    Where...

    <username> = your cpanel login
    <mydomain.com> = your website
    <login> = your email login name (before the @mydomain.com)

    2) Then try to send and receive email. It should be empty. You may need to restart POP/SMTP.

    3) Try sending an email to yourself and see if the 'inbox' file is recreated. If that works and it downloaded your test email message, then remove the 'inbox.bak'

    rm /home/<username>/mail/<mydomain.com>/<login>/inbox.bak

    Let me know if that works.
     
  3. ntwaddel

    ntwaddel Member

    Joined:
    Nov 3, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Templeton, CA
    or just echo "" > /home/<username>/mail/<mydomain.com>/<login>/inbox

    but you wont have a backup like the other guy said
     
  4. dalem

    dalem Active Member

    Joined:
    Oct 24, 2003
    Messages:
    2,231
    Likes Received:
    4
    Trophy Points:
    38
    Location:
    SLC
    or cat /dev/null>/home/<username>/mail/<domain>/<user>/inbox

    that willl empty it leaving the mailbox intact
     
  5. rpmws

    rpmws Active Member

    Joined:
    Aug 14, 2001
    Messages:
    1,838
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    this will also keep the perms right and it's quick
     
  6. rpmws

    rpmws Active Member

    Joined:
    Aug 14, 2001
    Messages:
    1,838
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    actually I think I have been using cp /dev/null /home/user/mail/domain/mailuser/inbox
     
  7. afraser

    afraser New Member

    Joined:
    Jan 7, 2005
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Some say that shutting down your mail server for three days will also do the trick. If you do this, please let me know if it works.
     
  8. brianoz

    brianoz Active Member

    Joined:
    Mar 13, 2004
    Messages:
    1,152
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    Shutting down your mailserver for 3 days won't work, but if you drink only red wine and sleep with your head pointing north for a week, and make VERY sure you don't step on any cracks in the sidewalk during that time, that will do the trick every time. Guaranteed. Promise.






    :D



    (ps: and looking into RBLs for the domain in question might help too!)
     
  9. jdonoso

    jdonoso Member

    Joined:
    Nov 15, 2004
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    The Third Rock from The Sun!
    Who the hell can afford to shutdown the mail server for like three days? :rolleyes:
    I don't blame brianoz for making fun of that comment. :p

    Regards,
     
  10. rpmws

    rpmws Active Member

    Joined:
    Aug 14, 2001
    Messages:
    1,838
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    RBLs do it ..I started using them serverwide 3 months ago and graphing with MRTG blocks and delivered and the total # of blocked and total emails have dropped dramatically. One box would block 120k per day ..now it's only seeing 40k emails per day. I think the spammers give up on boxes that block ..but it could be that they all live in Calif and the rain and mud has washed them away.
     
  11. brianoz

    brianoz Active Member

    Joined:
    Mar 13, 2004
    Messages:
    1,152
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    Ahhhh ... but I'm an Aussie, and we make fun of anything that isn't tied down :D
     
  12. dalem

    dalem Active Member

    Joined:
    Oct 24, 2003
    Messages:
    2,231
    Likes Received:
    4
    Trophy Points:
    38
    Location:
    SLC
    it just empty's the box to to /dev/null land and leave everything as it should be it takes one second and they are all gone
     
  13. peterallcdn

    peterallcdn New Member

    Joined:
    Feb 4, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I have several defalut email accounts that are like 1.5GB. I've just used a script from this forum to set all default emails address to :fail: but now I'm stuck trying to clean up these huge unused email inboxes.

    Can the quoted code above empty a default email account inbox also? Something like...

    Code:
    cat /dev/null>/home/username/mail/inbox
    If not, can someone tell me a way empty the cpanel default email accounts... preferably not the sloooooooowwwww FTP way.

    Thank you all!
    Peter
     
  14. peterallcdn

    peterallcdn New Member

    Joined:
    Feb 4, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello again,

    Actually, I tried this and it seems to work...
    Code:
    $ cd /home/username/mail
    $ rm -rf cur
    $ rm -rf new
    It completely removes the "new" and "cur" email folders for the default account.

    Is there anything wrong with this technique? Will cPanel/WHM still provide accurate disk usage and quotas etc...?

    Thanks for any help and or advice,

    Peter
     
  15. ThomasC

    ThomasC New Member

    Joined:
    Feb 7, 2003
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Edinburgh, UK
    Hello Peter,

    We have been using this method for a very long time and never had any problems from doing so.
    I can confirm that our disk usage still update correctly after this fix has been done.

    Thanks
     
  16. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    If you are getting that much spam to the master address for the account, sounds like you probably have setup the address as a global default for the domain.

    This is always a bad idea because spammers will just send spam to random names at your domain which normally would never be delivered but since you accept a global default, it instead gets delivered and the spam piles up in huge amounts.

    Really you should set the default for the domain to ":fail:" and then setup the account names tha you actually use for the domain individually as email accounts or aliases.
     

Share This Page