[lug] Virtual Mail User - Large Mailbox Scrubbing
jeff at zingstudios.net
Thu Jun 29 17:24:40 MDT 2006
> > for file in `grep -li "^Subject:.*undeliverable"`; do rm $file;
> > done
> This may not be quite right. It will find messages matching your
> pattern on any line, not just the Subject header.
I'm using the caret to indicate start-of-line, and a colon after
"Subject", which should really cut down on false positives. I agree
that it's *possible* a message containing
anywhere in its body (so long as it's on a new line AND followed by a
colon) will be picked up by this-- but it's unlikely that will happen.
There are Perl modules specifically intended for extracting e-mail
headers and searching them, but the resulting command will be much more
complicated than a one-liner. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 191 bytes
Desc: not available
More information about the LUG