Solaris 8 and 9 Bulk Mail Deletion

  • Follow


Hi folks

After logging in daily as root, I check mail upon seeing the "You have
mail" banner. On some servers, it seems that there is mail from 6
months ago; I would rather not simply use the d command one by one and
was wondering if a command exists to delete all the messages at once.

I have heard that the mail is just a text file that can be deleted but
I am not sure where it is.

Ideas? Thanks!  //Dave

0
Reply david 3/7/2006 8:56:56 PM

david.knight@bell.ca wrote:
> Hi folks
> 
> After logging in daily as root, I check mail upon seeing the "You have
> mail" banner. On some servers, it seems that there is mail from 6
> months ago; I would rather not simply use the d command one by one and
> was wondering if a command exists to delete all the messages at once.

$ mailx
  d *

should delete all email 

> 
> I have heard that the mail is just a text file that can be deleted but
> I am not sure where it is.

Waiting email for user root is held in the file /var/mail/root. 
rm /var/mail/root
will delete all email for user root.

However, it would be better to arrange the email for root be forwarded to
someone who may be interested rather than ignored.  You can add a line

root: root,someone@another.site.com

to /etc/mail/aliases and run the command newaliases will foreward root email
to a remote destination (of course, use your own address rather than
someone@another.site.com.)

-- 
Geoff Lane, Airstrip One

Adding manpower to a late software project only makes it later.
0
Reply Geoff 3/7/2006 9:04:34 PM


Hi Experts,

I am suggesting giveing  simple solution  to avoid this alerts.... you
can edit the /etc/profile & comment the following line...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /bin/mail -E
                case $? in
                0)
                        echo "You have new mail."
                        ;;
                2)
                        echo "You have mail."
                        ;;
                esac
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I hope this will help u.

Thanks
Mahi


Geoff Lane wrote:
> david.knight@bell.ca wrote:
> > Hi folks
> >
> > After logging in daily as root, I check mail upon seeing the "You have
> > mail" banner. On some servers, it seems that there is mail from 6
> > months ago; I would rather not simply use the d command one by one and
> > was wondering if a command exists to delete all the messages at once.
>
> $ mailx
>   d *
>
> should delete all email
>
> >
> > I have heard that the mail is just a text file that can be deleted but
> > I am not sure where it is.
>
> Waiting email for user root is held in the file /var/mail/root.
> rm /var/mail/root
> will delete all email for user root.
>
> However, it would be better to arrange the email for root be forwarded to
> someone who may be interested rather than ignored.  You can add a line
>
> root: root,someone@another.site.com
>
> to /etc/mail/aliases and run the command newaliases will foreward root email
> to a remote destination (of course, use your own address rather than
> someone@another.site.com.)
>
> --
> Geoff Lane, Airstrip One
> 
> Adding manpower to a late software project only makes it later.

0
Reply mahi 3/8/2006 9:40:38 AM

2 Replies
792 Views

(page loaded in 0.049 seconds)

Similiar Articles:













7/23/2012 12:47:54 PM


Reply: