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.

nuke a mailbox (new mail type)

Discussion in 'E-mail Discussions' started by simonpearce, Dec 4, 2006.

  1. simonpearce

    simonpearce Well-Known Member

    Joined:
    Jun 20, 2003
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    When a user had thousands of messages in their mailbox, we used to be able to echo -n>inbox to empty them all out; this doesn't work with the new mail system.

    When I try rm -rf * in the /cur and /new directories I get:

    Code:
    -bash: /bin/rm: Argument list too long
    Any suggestions please?

    Cheers

    Simon
     
  2. Romka_

    Romka_ Member

    Joined:
    Dec 28, 2005
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    !

    You can delete this directories and recreate itself.

    rm -rf cur; mkdir cur
    etc....

    But you must first look for owner and group for this folders and change it after recreate.

    This is my method.
     
    #2 Romka_, Dec 4, 2006
    Last edited: Dec 4, 2006
  3. Romka_

    Romka_ Member

    Joined:
    Dec 28, 2005
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    This is example from my box where i`m use postfix.

    Code:
    #!/usr/local/bin/bash
    
    echo "Postfix - STOP"
    /usr/local/sbin/postfix stop
    
    echo "Remove curent folders..."
    rm -rf /usr/spool/postfix/defer
    rm -rf /usr/spool/postfix/deferred
    rm -rf /usr/spool/postfix/active
    
    echo "Create new folders..."
    mkdir /usr/spool/postfix/defer
    mkdir /usr/spool/postfix/deferred
    mkdir /usr/spool/postfix/active
    
    echo "Change permition for folders..."
    chown -R postfix:postfix /usr/spool/postfix/defer
    chown -R postfix:postfix /usr/spool/postfix/deferred
    chown -R postfix:postfix /usr/spool/postfix/active
    
    echo "Postfix - START"
    /usr/local/sbin/postfix start
    
    
     
  4. simonpearce

    simonpearce Well-Known Member

    Joined:
    Jun 20, 2003
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Would "Repair Mailbox permissions" in WHM fix the permissions????
     
  5. lostinspace

    lostinspace Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    122
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Colorado Springs, CO
    http://www.configserver.com/cp/cmm.html might make your life easier.
     
  6. simonpearce

    simonpearce Well-Known Member

    Joined:
    Jun 20, 2003
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    This is brilliant - simple to install - simple to use - deleted 64000 messages from a mailbox in just a few seconds!

    Would highly recommend.
     
  7. lostinspace

    lostinspace Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    122
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Colorado Springs, CO
    Tip of the iceberg my friend. You should check out Chirpy's CSF...
     
  8. bear

    bear Well-Known Member

    Joined:
    Sep 24, 2002
    Messages:
    113
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    We're loving Chirpy's scripts. Definitely another fine one from him..thanks, Jon!
     
  9. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    526
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brno, Czech Republic
    csf cse cmm mailscanner - a must for every web server. rocks.
     
Loading...

Share This Page