Operating System - HP-UX
1753903 Members
10018 Online
108810 Solutions
New Discussion юеВ

How to delete mail messages

 
SOLVED
Go to solution
feryfarah
Advisor

How to delete mail messages

Hi,
I have a large size of root mail in my HP-UX server.
I tried to delete by using #rm command but it didn't work.
I tried to delete using d command when i'm in the root mail (using #more command), but it still didn't work.
My /var directory space is getting compact (over 95% utilized) and I'm in the process of deleting unnecessary files in /var directory.

Please assist me.
Thanks
19 REPLIES 19
Mridul Shrivastava
Honored Contributor

Re: How to delete mail messages

check the files under /var/mail and locate the largest file.

Take a backup of that file or copy it on other filesystem then nullify this file using the cat command as below

cat > /var/mail/

This will create more space under /var
Time has a wonderful way of weeding out the trivial
feryfarah
Advisor

Re: How to delete mail messages

Hi,
I tried to use cat command and inserted:-
hi
my name


when I read back the mail...messages as below keep coming...

hi
my name
ern_file...] [file...]
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] [-e pattern_list...]
-f pattern_file... [file...]
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] pattern [file...]
grep: illegal option -- 3
grep: illegal option -- 4
grep: illegal option -- 2
grep: illegal option -- 0
grep: illegal option -- 0
grep: illegal option -- 0
grep: illegal option -- 8
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] -e pattern_list...
[-f pattern_file...] [file...]
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] [-e pattern_list...]
-f pattern_file... [file...]
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] pattern [file...]
grep: illegal option -- 3
grep: illegal option -- 4
grep: illegal option -- 0
grep: illegal option -- 4
grep: illegal option -- 0
grep: illegal option -- 4
grep: illegal option -- 7
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] -e pattern_list...
[-f pattern_file...] [file...]
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] [-e pattern_list...]
-f pattern_file... [file...]
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] pattern [file...]
grep: illegal option -- 3
grep: illegal option -- 4
grep: illegal option -- 0
grep: illegal option -- 4
grep: illegal option -- 0
grep: illegal option -- 4
.
.
.
the size keep bigger.
# ls -l
total 471136
-rw-rw---- 1 root mail 234728993 Jan 7 10:34 root
# ls -l
total 471136
-rw-rw---- 1 root mail 239718479 Jan 7 10:34 root
# ls -l
total 503904
-rw-rw---- 1 root mail 252432821 Jan 7 10:34 root
Mridul Shrivastava
Honored Contributor

Re: How to delete mail messages

use the following command to nullify then

cat /dev/null > /var/mail/root

Make sure that u have a backup of this root file before executing this command.
Time has a wonderful way of weeding out the trivial
feryfarah
Advisor

Re: How to delete mail messages

Thanks.
I managed to empty the root mail.
But it keeps filling in with the unknown message.
Mridul Shrivastava
Honored Contributor

Re: How to delete mail messages

Since when It started, I mean was there any changes made after that this problem started???

Normally all root mails will go to to root and this file size increases but if it is increasing with in a day or so then it is a thing to look out...

Is there any other error message ??
How abt the mail delivery, are the messages being delivered by the system ??
Time has a wonderful way of weeding out the trivial
feryfarah
Advisor

Re: How to delete mail messages

I didn't notice when it started.
hope u'll find something from this.

From MAILER-DAEMON@hpovnnm Mon Jan 7 11:00:22 mal 2008
Received: from localhost (localhost)
by hpovnnm (8.9.3 (PHNE_29774)/8.9.3) with internal id SLD25533;
Fri, 4 Jan 2008 20:50:37 +0800 (mal)
Date: Fri, 4 Jan 2008 20:50:37 +0800 (mal)
From: Mail Delivery Subsystem
Message-Id: <200801041250.SLD25533@hpovnnm>
To: postmaster@hpovnnm
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="SLD25533.1199451037/hpovnnm"
Subject: Postmaster notify: Cannot send message within 5 days
Auto-Submitted: auto-generated (postmaster-notification)

This is a MIME-encapsulated message

--SLD25533.1199451037/hpovnnm

The original message was received at Sun, 30 Dec 2007 05:33:24 +0800 (mal)
from localhost

----- The following addresses had permanent fatal errors -----
root
(expanded from: postmaster)

----- Transcript of session follows -----
mail: cannot append to /var/mail/root
mail: cannot create dead.letter
451 I/O error
Message could not be delivered for 5 days
Message will be deleted from queue

--SLD25533.1199451037/hpovnnm
Content-Type: message/delivery-status

Reporting-MTA: dns; hpovnnm
Arrival-Date: Sun, 30 Dec 2007 05:33:24 +0800 (mal)

Final-Recipient: RFC822; postmaster@hpovnnm
X-Actual-Recipient: RFC822; root@hpovnnm
Action: failed
Status: 4.4.7
Last-Attempt-Date: Fri, 4 Jan 2008 20:50:37 +0800 (mal)

--SLD25533.1199451037/hpovnnm
Content-Type: message/rfc822

Return-Path:
Received: from localhost (localhost)
by hpovnnm (8.9.3 (PHNE_29774)/8.9.3) with internal id EIR27294;
Sun, 30 Dec 2007 05:33:24 +0800 (mal)
Date: Sun, 30 Dec 2007 05:33:24 +0800 (mal)
From: Mail Delivery Subsystem
Message-Id: <200712292133.EIR27294@hpovnnm>
To: postmaster
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="EIR27294.1198964004/hpovnnm"
Subject: Postmaster notify: Cannot send message within 5 days
Auto-Submitted: auto-generated (postmaster-notification)

This is a MIME-encapsulated message

--EIR27294.1198964004/hpovnnm

The original message was received at Tue, 25 Dec 2007 02:06:15 +0800 (mal)
from localhost

----- The following addresses had permanent fatal errors -----
root
(expanded from: postmaster)

----- Transcript of session follows -----
mail: cannot append to /var/mail/root
mail: cannot create dead.letter
451 I/O error
Message could not be delivered for 5 days
Message will be deleted from queue

--EIR27294.1198964004/hpovnnm
Content-Type: message/delivery-status

Reporting-MTA: dns; hpovnnm
Arrival-Date: Tue, 25 Dec 2007 02:06:15 +0800 (mal)

Final-Recipient: RFC822; postmaster@hpovnnm
X-Actual-Recipient: RFC822; root@hpovnnm
Action: failed
Status: 4.4.7
Last-Attempt-Date: Sun, 30 Dec 2007 05:33:24 +0800 (mal)

--EIR27294.1198964004/hpovnnm

Mridul Shrivastava
Honored Contributor

Re: How to delete mail messages

I understand that there were lots of messages in queue and unable to append the root file and now they can not be delivered since it is more that 5 days now.

What is the current status of the root mails and file size ??

try sending a test message ad check if it succeeds:
mailx -s "test"
test
.

then tail -f /var/adm/syslog/mail.log

check if stat is equal to sent or not ??
Time has a wonderful way of weeding out the trivial
feryfarah
Advisor

Re: How to delete mail messages

here is the result.

# mailx -s "test" 200801041250.SLD25533@hpovnnm
test
EOT
#
# tail -f /var/adm/syslog/mail.log
Nov 15 14:16:58 hpovnnm sendmail[23463]: SDN19702: to=root, delay=1+15:04:55, xdelay=00:00:00, mailer=local, stat=I/O error
Nov 15 14:16:59 hpovnnm sendmail[23463]: SGG11673: to=root, delay=1+16:27:43, xdelay=00:00:01, mailer=local, stat=I/O error
Nov 15 14:16:59 hpovnnm sendmail[23463]: RZQ16262: to=root, delay=1+17:42:56, xdelay=00:00:00, mailer=local, stat=I/O error
Nov 15 14:16:59 hpovnnm sendmail[23463]: RHA16262: to=root, delay=1+18:09:39, xdelay=00:00:00, mailer=local, stat=I/O error
Nov 15 14:16:59 hpovnnm sendmail[23463]: SYP11673: to=root, delay=1+15:55:37, xdelay=00:00:00, mailer=local, stat=I/O error
Nov 15 14:17:00 hpovnnm sendmail[23463]: RcN16262: to=root, delay=1+17:34:26, xdelay=00:00:01, mailer=local, stat=I/O error
Nov 15 14:17:00 hpovnnm sendmail[23463]: RqE16262: to=root, delay=1+17:20:48, xdelay=00:00:00, mailer=local, stat=I/O error
Nov 15 14:17:00 hpovnnm sendmail[23463]: RZI16262: to=root, delay=1+17:43:15, xdelay=00:00:00, mailer=local, stat=I/O error
Nov 15 14:17:00 hpovnnm sendmail[23463]: RZR16262: to=root, delay=1+17:42:56, xdelay=00:00:00, mailer=local, stat=I/O error
Nov 15 14:17:00 hpovnnm sendmail[23463]: SFY11673: to=root, delay=1+16:28:38, xdelay=00:00:00, mailer=local, stat=I/O error
Nov 15 14:17:01 hpovnnm sendmail[23463]: SFN11673: to=root, delay=1+16:29:3#
#
# ls -l
total 4355184
-rw-rw---- 1 root mail 2147483647 Jan 7 11:32 root
Mridul Shrivastava
Honored Contributor

Re: How to delete mail messages

There is an I/o error so mails are not getting delivered.. please check if sendmail daemon is running or not.

ps -ef|grep sendmail


Time has a wonderful way of weeding out the trivial