nuke a mailbox (new mail type)

simonpearce

Well-Known Member
Jun 20, 2003
90
0
156
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
 

Romka_

Member
Dec 28, 2005
18
0
151
!

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.
 
Last edited:

Romka_

Member
Dec 28, 2005
18
0
151
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
 

simonpearce

Well-Known Member
Jun 20, 2003
90
0
156
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.
Would "Repair Mailbox permissions" in WHM fix the permissions????
 

lostinspace

Well-Known Member
Jul 19, 2003
122
1
168
Colorado Springs, CO
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
http://www.configserver.com/cp/cmm.html might make your life easier.
 

katmai

Well-Known Member
Mar 13, 2006
564
4
168
Brno, Czech Republic
csf cse cmm mailscanner - a must for every web server. rocks.