Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Easy way to delete 80000k emails?

  1. #1
    Registered Member
    Join Date
    Feb 2004
    Posts
    10

    Default Easy way to delete 80000k emails?

    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. #2
    Registered Member
    Join Date
    Oct 2002
    Posts
    105

    Post 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. #3
    Registered Member ntwaddel's Avatar
    Join Date
    Nov 2003
    Location
    Templeton, CA
    Posts
    173

    Default

    or just echo "" > /home/<username>/mail/<mydomain.com>/<login>/inbox

    but you wont have a backup like the other guy said

  4. #4
    Registered Member cPanel Partner NOC Badge
    Join Date
    Oct 2003
    Posts
    2,184

    Default

    or cat /dev/null>/home/<username>/mail/<domain>/<user>/inbox

    that willl empty it leaving the mailbox intact

  5. #5
    Registered Member rpmws's Avatar
    Join Date
    Aug 2001
    Location
    back woods of NC, USA
    Posts
    1,839

    Default

    Quote Originally Posted by dalem
    or cat /dev/null>/home/<username>/mail/<domain>/<user>/inbox

    that willl empty it leaving the mailbox intact
    this will also keep the perms right and it's quick
    Just keeping my "eye" on things....
    R. Paul Mathews
    RPMWS - diehard cPanel Nutcase

  6. #6
    Registered Member rpmws's Avatar
    Join Date
    Aug 2001
    Location
    back woods of NC, USA
    Posts
    1,839

    Default

    Quote Originally Posted by rpmws
    this will also keep the perms right and it's quick
    actually I think I have been using cp /dev/null /home/user/mail/domain/mailuser/inbox
    Just keeping my "eye" on things....
    R. Paul Mathews
    RPMWS - diehard cPanel Nutcase

  7. #7
    Registered Member
    Join Date
    Jan 2005
    Posts
    5

    Default

    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. #8
    Registered Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,154
    cPanel Access Level

    Root Administrator

    Default

    Quote Originally Posted by afraser
    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.
    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.










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

  9. #9
    Registered Member
    Join Date
    Nov 2004
    Location
    The Third Rock from The Sun!
    Posts
    67

    Default

    Quote Originally Posted by afraser
    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.
    Who the hell can afford to shutdown the mail server for like three days?
    I don't blame brianoz for making fun of that comment.

    Regards,
    Juan Carlos Donoso
    Vice-Manager TechDream.Net
    http.//www.techdream.net/

  10. #10
    Registered Member rpmws's Avatar
    Join Date
    Aug 2001
    Location
    back woods of NC, USA
    Posts
    1,839

    Default

    Quote Originally Posted by brianoz
    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.










    (ps: and looking into RBLs for the domain in question might help too!)
    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.
    Just keeping my "eye" on things....
    R. Paul Mathews
    RPMWS - diehard cPanel Nutcase

  11. #11
    Registered Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,154
    cPanel Access Level

    Root Administrator

    Default

    Ahhhh ... but I'm an Aussie, and we make fun of anything that isn't tied down

  12. #12
    Registered Member cPanel Partner NOC Badge
    Join Date
    Oct 2003
    Posts
    2,184

    Default

    this will also keep the perms right and it's quick
    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. #13
    Registered Member
    Join Date
    Feb 2004
    Posts
    9

    Default

    Quote Originally Posted by ntwaddel View Post
    or just echo "" > /home/<username>/mail/<mydomain.com>/<login>/inbox

    but you wont have a backup like the other guy said
    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. #14
    Registered Member
    Join Date
    Feb 2004
    Posts
    9

    Default

    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. #15
    Registered Member
    Join Date
    Feb 2003
    Location
    Edinburgh, UK
    Posts
    12

    Default

    Quote Originally Posted by peterallcdn View Post
    Is there anything wrong with this technique? Will cPanel/WHM still provide accurate disk usage and quotas etc...?
    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

Page 1 of 2 12 LastLast

Similar Threads

  1. Too easy to delete public_html via FTP user window
    By akmiecik in forum General Discussion
    Replies: 3
    Last Post: 10-05-2012, 06:40 AM
  2. easy way to delete backups of non-existant accounts?
    By Funkadelic in forum Workarounds and Optimization
    Replies: 9
    Last Post: 05-07-2010, 02:25 PM
  3. delete emails from shell
    By Valuehosted in forum E-mail Discussions
    Replies: 2
    Last Post: 06-26-2004, 12:45 PM
  4. delete emails?
    By chadi in forum E-mail Discussions
    Replies: 1
    Last Post: 04-30-2004, 02:33 PM
  5. It's too easy to delete MySQL databases via Cpanel!
    By Valetia in forum General Discussion
    Replies: 1
    Last Post: 02-15-2004, 01:08 PM
bargain