• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

wanting to delete mail in unix through find....

Okay, so I've got a bunch of email which was sent by a virus...

I'm in the location where it has all the mail.

I'd like to delete that mail...so far what I have is this...

find ./ | xargs grep Win32.Mix| rm <insert command here>

I'd like to delete whatever file find grabs that has detected the Win32.Mix virus....

just can't quite figure out the command i'm missing.

Would anyone happen to know?

Thanks!
 
Wait, do you have all mails in a seperate file each, one file per mail?

If not (you probably don't), use formail (out of the procmail packages) or "agrep". agrep doesn't ship with many distributions but can be found somewhere, version 2.04. It allows you to do a grep on single mails in a mailfolder with many mails.
 
if you find bad e-mails, copy them to a folder before deleting them. rm is to powerfull and you don't want to accedently delete the wrong stuff thru a typo.
 
just can't quite figure out the command i'm missing.

Where your mail is kept is critical to how you delete it. Is it in mbox or maildir format? If it's mbox that means each 'folder' of your mail is a single file, so deleting that file will delete the entire folder. If it's maildir I believe there's a header file and a body file, so you would need to delete both.
 
As long as Jero doesn't describe how his mail is stored this discussion is moot 🙁

 
Originally posted by: MartinCracauer
Wait, do you have all mails in a seperate file each, one file per mail?

If not (you probably don't), use formail (out of the procmail packages) or "agrep". agrep doesn't ship with many distributions but can be found somewhere, version 2.04. It allows you to do a grep on single mails in a mailfolder with many mails.

using exim
 
Originally posted by: Jero
Originally posted by: MartinCracauer
Wait, do you have all mails in a seperate file each, one file per mail?

If not (you probably don't), use formail (out of the procmail packages) or "agrep". agrep doesn't ship with many distributions but can be found somewhere, version 2.04. It allows you to do a grep on single mails in a mailfolder with many mails.

using exim

i'm sorry for my lack of details prior.

mail is located in /var/spool/exim/input

that is where i'm doing a find.
 
Back
Top