Page 1 of 1

Delete All Email of a Certain Pattern

Posted: Mon Jul 09, 2007 11:01 am
by davidz
I need to delete all the email on the server that matches a certain pattern. Over the weekend we have a large volume of spam make it through the spam filter (we use barracuda). All the emails have the exact same pattern. Can I use something like omtidyu to delete all of these emails from people's mailboxes before they click on the virus link.

--Thanks, David

Posted: Tue Jul 10, 2007 4:36 am
by Richard Hall
Hi David,

Yes, omtidyallu is the utility you need to run. You can use wildcarded sender and subject strings to make the selection. Just using just omtidyu without actually deleting any items will allow you to test that the filter criteria are correct.

For example:
omtidyu -B -u <user> -Ti -a 0 -m spammer@acme.com -t *pills* -R
will list the messages in the user's Inbox that were sent by spammer@acme.com and contain "pills" in the subject.

When you are happy with the filter you can apply it to everyone and delete the items:
omtidyallu -Ti -a 0 -m spammer@acme.com -t *pills* -d -k

(The items will not be moved to the Deleted Items folder as the -k option is specified, but they will be moved to Recovery Folder.)

Cheers - Richard

Posted: Tue Jul 10, 2007 5:50 am
by Valerion
Yes, but use omtidyallu - it applies to all mailboxes. Just be sure to read the man pages carefully, it's easy to delete too many emails by mistake.

Posted: Tue Jul 10, 2007 9:45 am
by davidz
Thanks for the info, that is exactly what I was hoping for!!


David