Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

delete all mails from multiple mailboxes

Posted on 2002-03-26
4
Medium Priority
?
220 Views
Last Modified: 2010-04-20
I have 100 mailboxes with many mails. I want to delete all mails from all accounts.

is there any command for this
0
Comment
Question by:ashishn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 150 total points
ID: 6896405
'rm /var/spool/mail/*' will delete all of the inboxes on the system. If you don't actaully want to delete everyting you  can deleted the files in /var/spool/mail that belong to user's whose mailboxes are to be emptied.
0
 
LVL 3

Expert Comment

by:neostudio
ID: 6898174
try this...........
PS>> PSEUDO CODE [NOT TESTED]



touch /sbin/cleanmail.sh
vi /sbin/cleanmail.sh

====================
!#/bin/sh
rm /var/spool/mail/*
echo "Mailboxes Cleaned, Asta La Vista !"
exit 0

chmod 755 /sbin/cleanmail.sh
=====================

you can also set to run in on each reboot for example, or do not use it at all...


regards,
</Ruslan>
0
 
LVL 3

Expert Comment

by:neostudio
ID: 6899518
just interested,
why did you grade this answer as a B ??
it is 100% an A answer, isn't it ??

0
 

Author Comment

by:ashishn
ID: 6901610
b'se I was looking for a solution to delete all mails in all 100 accounts using single command.

I found the solution as

cd /var/spool/mail
for i in mobi*; do 'cat /dev/null > $i; done

0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question