Delete all mails using mailx or mail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Delete all mails using mailx or mail
# 1  
Old 11-06-2006
Delete all mails using mailx or mail

Hi , ?im a newbie using shell scripts.
Is there any way to write a script that will delete all mails from my mailbox using mail or mailx command

Thanks for your time

E. Festas
# 2  
Old 11-06-2006
I guess the question is why use mail or mailx? Why not just delete your mailbox?

Code:
$ rm /var/spool/mail/rfestus

Carl
# 3  
Old 11-07-2006
Another way :
Code:
echo 'd *' | mail -N


Jean-Pierre.
This User Gave Thanks to aigles For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Mailx command running successfully but no mails received.

Hi, I am working on a HP-UX box. Mailx command running successfully but no mails received. Here is what I am doing rocfm@comhp73 - mailx -s "subject" abc@gmail.com < abc.txt Null message body; hope that's ok rocfm@comhp73 - echo $? 0 rocfm@comhp73 - echo "something" | mailx -v -s... (1 Reply)
Discussion started by: Sunayna
1 Replies

2. Red Hat

Problems sending mail: Difference between Mail and Mailx?

Whats the difference between mail and mailx? I'm trying to troubleshoot a problem where I can send mail from server A with this `echo $MESSAGE | mail -s "$SUBJECT" -r $FROM $RECIPIENTS` command but executing the same command from server B throws me this error (Both servers are RHEL) ... (1 Reply)
Discussion started by: RedSpyder
1 Replies

3. IP Networking

Set default return address for all mails sent from mailx

Hi, I have a question about mailx in Red Hat: If I use 'mail userid@mydomain.com -- -f root@mydomain.com', the return mail address will be root@mydomain.com. How can I make all mails sent from this system use root@mydomain.com as return address by default? Thank you in advance! nz (1 Reply)
Discussion started by: aixlover
1 Replies

4. Shell Programming and Scripting

2 mails from mailx command

hi, While using mailx command i am receiving 2 mails with the same content in both the mails.I am attaching a file to the mailx command. In one mail file is coming as attachement and in other attachment is not there. I am using mailx command in this way. echo "Some content" |mailx... (0 Replies)
Discussion started by: arijitsaha
0 Replies

5. Shell Programming and Scripting

mailx- how to delete least of mails

Hi, when i run the mailx command it gives me the least of mails . suppose there are 1- 150 mails and i want to delete 30 to 145 mails . then what command i have to use here? Thanks (6 Replies)
Discussion started by: aish11
6 Replies

6. Shell Programming and Scripting

mailx is not working outside e-mails

HI i wrote schell script to send e-mail automatically. it works only e-mail for our company.say for example, company name is : abc, example: joe@abc.com every body is receiving with xxx@abc.com (abc.com) if any body from outside of our company like joe@xyz.com.(xyz.com) are not... (3 Replies)
Discussion started by: raosurya
3 Replies

7. Debian

cannot send any mails using mailx

hi howto configure mailx ? kind regards ccc (11 Replies)
Discussion started by: ccc
11 Replies

8. Shell Programming and Scripting

Script to delete all mail in mailx

Hello all, Can some help me write a small script that when executed will delete all mail in mailx? I am having issues where /var is getting full often due to a lot of mail being stored, I would like to run a script on cron which would delete mail every 2 days, any help is much appreciated. (1 Reply)
Discussion started by: sqloyd
1 Replies

9. UNIX for Dummies Questions & Answers

Does Mailx store the mails sent

Hi, I use mailx in a shell script to mail a message to the users. i wanted to know if mailx stores the mail that it sends? for eg in microsoft outlook all mails sent get stored in the outbox. is there such a facility with mailx? if not how i can do this so that for every mail sent, a backup... (6 Replies)
Discussion started by: munira_johar
6 Replies

10. Solaris

how to send mails to users on exchange server from sendmail/solaris(mailx)

Hi, Can anyone pls. tell me how to access Active directory from solaris. I am looking at solution by which I can send mail notification from the logs generated by scripts, to the users on Exchange server. I am trying for a Perl-LDAP module , but don't realy know how to go for it (5 Replies)
Discussion started by: ganeshh
5 Replies
Login or Register to Ask a Question