I have so many mails in my mailbox and I just cant delete each one individually. Is there a way to clear up every mail in my mail box without having to actually deal with each one separately????
If you can access the /var/mail directory, you may be able to remove the file. Look for a file with your userID.
You could also create a script to read mail and delete it with a for or while loop (if you have an idea of how many messages { you can tell that via the header option in mail I believe}).
Even the very simplistic "mail" client should let you delete a batch of messages. Try issuing the command "mail" followed by the command "d 1-50"
to, for example, delete message #'s 1-50.
I tried the d 1-50 on both Solaris and HP-UX and it did not work. What OS have you seen this work on?
I use the 'd 1-50' method on AIX to clean out a couple of generic user accounts, just be sure to 'quit' out of the mail program and not 'exit' otherwise the mails will not be deleted
It wasn't that it worked and I exited - it didn't like the command
SUN:
? h
5 letters found in /var/mail/root, 0 scheduled for deletion, 0 newly arrived
> 5 2529 anyone@exchange.inThu Apr 11 05:00 EDT 2002 Thu Apr 11 05:00 EDT 2002
4 2330 Noone@exchanThu Mar 14 05:00 EST 2002 Thu Mar 14 05:00 EST 2002
3 3442 someone@exchange.inFri Mar 8 09:39 EST 2002 Fri Mar 8 09:39 EST 2002
2 2492 MAILER-DAEMON Fri Mar 8 06:18 EST 2002
1 2492 MAILER-DAEMON Fri Mar 8 06:18 EST 2002
? d 3-4
Illegal numeric
HP-UX:
? h
usage
q quit
x exit without changing mail
p print
s [file] save (default mbox)
w [file] same without header
-
print previous
d delete
+ next (no delete)
m user mail to user
! cmd execute cmd
? d 1-3
From unixops Thu Apr 11 17:02:19 EDT 2002
Received: (from unixops@localhost)
by isaac.tampa.inmyworld.com (8.8.6 (PHNE_17190)/8.8.6) id RAA08371
for unixops; Thu, 11 Apr 2002 17:02:19 -0400 (EDT)
Date: Thu, 11 Apr 2002 17:02:19 -0400 (EDT)
From: Unix Admin <unixops>
Message-Id: <200204112102.RAA08371@isaac.tampa.inmyworld.com>
To: unixops
Subject: ignore test
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
this is a test file
?q
HP didn't give an error but didn't delete the mail either.