Is there a way to use Regular Expressions in Outlook rules?

10

2

Our mail server manages to filter a lot of spam, but the spammers seem to be finding ways to get around it. I am finding that much the current crop of stuff that gets through could be filtered on my end if only I could make a rule that could clue in on stuff that a regular expression could ferret out. Here's a very consistent thing in the message body of a large number of messages:

<!-- http://pieqc.medicggin.com  -->

I look in the list of conditions in the Rules Wizard and I see nothing that helps, but perhaps I don't see something that could work?

This is Outlook 2007.

Cyberherbalist

Posted 2010-09-14T15:43:04.990

Reputation: 655

I'm going to recommend moving this to StackOverflow, since this involves a fair bit of programming. FOr RegEx & VBScript reference, have a look at http://msdn.microsoft.com/en-us/library/ms974570.aspx

– Sathyajith Bhat – 2010-09-14T18:06:07.183

See my comments to your answer, below. – Cyberherbalist – 2010-09-14T18:36:40.230

Answers

3

I replied to your stackoverflow question. Hopefully that will help. Keep in mind that using the 'run script' action is just an action, and not a condition. To be effective, it'll have to be in the top rule handling all incoming messages, and then the script just inspects the contents and moves/deletes the message item or just skips over it letting the next rule in line take it from there.

You could also manage this through item/application events. See Microsoft Outlook Programming: Jumpstart for Administrators, Developers, and Power Users: Section 11.5.3 for an example.

bob-the-destroyer

Posted 2010-09-14T15:43:04.990

Reputation: 216

0

There is a rule where you can check for specific words in the body, perhaps you could try that ? alt text

Sathyajith Bhat

Posted 2010-09-14T15:43:04.990

Reputation: 58 436

Sigh. I have already been using it for some of the spam that kindly misspells the words "viagra" "cialis" and "replica" -- you know, leet-speak misspellings, presumably to deceive heuristics. It's easy to catch "v1agr4", "c14lis". There's only so many ways to misspell these words before they become unintelligible. But other kinds of things, like the one I mention in the question, are too complex. I can't catch on a particular domain link, for example, because they use so many. It would be a full time job keeping track of them all. – Cyberherbalist – 2010-09-14T17:33:15.453

@Cyberherbalist You can use Macros & VBA in Outlook. VBA can support RegEx. Here's a link documenting that - http://msdn.microsoft.com/en-us/library/ms974570.aspx

– Sathyajith Bhat – 2010-09-14T18:04:02.913

I'm aware of this, @Sathya, but I have never been able to find documentation on how to make a VBA script operate to check for certain properties in a message and take some action on it. A VBA script would have to run for every message arriving in Outlook, but there is no option that I can discover to make it so! I am asking here because maybe there is some obscure setting that I know nothing about that would enable what I am trying to do. If there is none, then so be it. – Cyberherbalist – 2010-09-14T18:33:39.240

In fact, I have a question out on StackOverflow asking how to get a VBA script to run (for another purpose than that mentioned here), and it has gone unanswered for over a year. http://stackoverflow.com/questions/836254/problem-getting-outlook-2007-running-vba-script

– Cyberherbalist – 2010-09-14T18:35:16.927

@Cyberherbalist Let me try to have a crack at it. Will update my progress probably tomorrow. – Sathyajith Bhat – 2010-09-14T18:43:07.437

0

Possibly not the answer you are looking for, but since you have a mail server then I presume you have > 1 people on your network picking up their mail from it?! In this case, having regular expressions on each client PC that will need regular tweaking seems to be tackling the problem at the wrong end and creating one heck of a support burden.

If your mail server is not performing all the filtering you need, I would suggest you start there and see what can be done about it.

What's your mail server running? (Exchange?)

Linker3000

Posted 2010-09-14T15:43:04.990

Reputation: 25 670

Yes, it's Exchange. They've got some 3rd party anti-spam solution in there, too. It catches a lot of stuff, but lately there seems to a lot getting through, more than before. I've talked with them; they're not particularly helpful. – Cyberherbalist – 2010-09-14T20:18:51.980