1 (edited by LordZ 2009-06-24 06:47:51)

Topic: deleting certain e-mail

Hello. I have a problem I have a mailbox that received about 60000 messages and a big part of them is bounce messages is there a way to delete all of them without deleting other messages....I started with finding all the files that contain a certain string

[root@mail]# grep -lr 'Mail delivery failed: returning' /home/vmail/birovits.md/office/cur/

but i don't know how to delete the list of files that is given. can anyone help?


Re: deleting certain e-mail

Try this:

$ grep -lr 'Mail delivery failed: returning' /home/vmail/birovits.md/office/cur/ | xargs rm -f {}

Warning: Use 'head/cat/tail' or whatever command you like to confirm that is the mail you want to delete, it's not recoverable.


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee