LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-01-2010, 01:42 AM   #1
jobud33
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Rep: Reputation: 0
delete mail root in command line


Hi!
I want to delete all may mail root in command line and i don't find this... the command mail + "d" work fine but i want use it in a .sh

i explain too : I use fetchmail to have mail from a gmail box, and use RIPMIME to save the attachment in a folder... these work fine, but the i want delete these mails

thanks all
---
En français sa donne :
j'ai besoin de deleté les mails root en ligne de commande et je ne trouve pas cette syntaxe... La commande "mail" + la touche "d" fonctionne mais je souhaite l'utiliser en ligne de commande...

le contexte : J'utilise fetchmail pour recuperer des mails d'une boite gmail et utilise RIPMIME pour détacher les piece jointe et les sauvegarder dans un dossier ....tout fonctionne bien sauf la suppression des mails déjà effectué!

Merci

jobud
- Debian etch -
 
Old 07-01-2010, 02:27 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can delete the file /var/spool/mail/root, so all root's mail will be deleted

Regards
 
Old 07-02-2010, 05:05 AM   #3
jobud33
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Original Poster
Rep: Reputation: 0
yes man

the command
rm -f /var/mail/myusername
delete all the mail ....
 
Old 07-02-2010, 05:53 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by jobud33 View Post
I use fetchmail to have mail from a gmail box, and use RIPMIME to save the attachment in a folder... these work fine, but the i want delete these mails
Since you run fetchmail you probably also have a procmail recipe. If that's the case, wouldn't it be easier to set delivery from a mailbox:
Code:
:0
* ^Subject:.*something.*$
$MAILBOX
to the bit bucket:
Code:
BITBUCKET=/dev/null
:0
* ^Subject:.*something.*$
$BITBUCKET
?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian etch - Unable to send mail from command line or from php mail command lqforumuser Linux - Newbie 1 03-01-2009 06:56 AM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 06:37 AM
Command line way to delete installation sources coldSteel SUSE / openSUSE 6 11-24-2006 11:31 AM
Delete root mail nepcw Red Hat 5 07-18-2004 01:01 PM
delete a group with command line feetyouwell Linux - Software 1 01-27-2004 09:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration