Cleaning out a mail box Via SSH?

Silverado

Well-Known Member
Mar 19, 2003
153
0
166
Backyard - Poolside
Does anyone know a good way to clean out a specific Email box using SSH? Or perphaps a script similar to the one used to wipe out the mail queue? I have a client that gets about 300MB of mail daily and he would like to wipe it out in one quick sweep.
Any suggestions are appreciated...... other than the obvious of deleting the email account. Thanks.
 

webtec

Member
Apr 18, 2002
7
0
301
What I've done in the past is simply null the file.

At a command line type:

>inbox

This will empty the box.
 

Silverado

Well-Known Member
Mar 19, 2003
153
0
166
Backyard - Poolside
could you possibly expound on this a bit. >inbox ---- I don't see how this will do any good from the root prompt? Or are you perhaps meaning add that to the path to the inbox.... LOL... if I ever find the inbox path in ssh.
 

Damian

Well-Known Member
Oct 1, 2001
115
9
318
You can just delete the inbox file, it will be recreated when needed.

The main account's inbox is located here:

/home/username/mail/

So to delete it issue:

rm /home/username/mail/inbox

Additional users & addon domain users are located here:

/home/username/mail/domain.com/user
/home/username/mail/addondomain.com/user

The same applies to delete them:

rm /home/username/mail/domain.com/user/inbox
rm /home/username/mail/addondomain.com/user/inbox