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?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

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.