

- #Outlook rule from domain wildcard how to
- #Outlook rule from domain wildcard code
- #Outlook rule from domain wildcard plus
The project will be listed as VBAProject.OTM. It should contain a project outline in a small panel in the top-left corner. I hate Outlook.įirst, you have to open the script editor via Tools - Macro - Open Visual Basic Editor (Alt-F11 is the shortcut). I do not know if a regex can be used directly in a rule, but you can have a rule trigger a script and the script can use regexes. If Not (MatchesSubject Is Nothing And MatchesBody Is Nothing) Then Set MatchesBody = RegEx.Execute(Message.Body) Set MatchesSubject = RegEx.Execute(Message.Subject) If (RegEx.Test(Message.Subject) Or RegEx.Test(Message.Body)) Then

#Outlook rule from domain wildcard code
I thought I would share my code below in case it is able to help anyone else: Sub JobNumberFilter(Message As Outlook.MailItem) I wasn't able to find anything concrete online about whether Outlook even supports entering regexes into a rule, though, so I figured I would ask here in case I'm wasting my time.ĮDIT: Thanks to Chris's comment below, I was able to implement this filter via a macro. I've tried a few other modifications as well with no luck. I was using this as a regex: \b\b but the filter isn't working. I'm trying to add a filter for messages containing a string such as: 4000-10, a four digit number followed by a dash and then a two digit number, which can be anything from 0000-00 to 9999-99.
#Outlook rule from domain wildcard how to
I'm open to Apple Scripts, though I don't yet know how to use it and don't know if it will work here.Is it possible to create rules in Outlook 2007 based on a regex string? While a better anti-spam program would be nice, it's not what I'm asking about and I still need a direct answer to my question even if I had a better spam filter. I want to be able to identify selected username patterns as probably spam. I already divert catch-all email to a "misc" account but I still have to go through it. Nor do I want to take the nuclear approach and change my domain name's settings at my ISP to junk every username I haven't specified (it's a pain to log in every time I whitelist a new username too). I just want to add a new username set as a line in an existing rule. One where it meets the requirements of "contains username" and "contains domain name." Why? Because I'd need hundreds of them. I also don't want to create a separate rule for every instance.

I must be able to put in my domain name as part of the rule.
#Outlook rule from domain wildcard plus
Since it's not just one friend Anne but rather multiple ones, plus countless usernames that might start with "x" or "z" and so forth, whitelisting won't work. Because that will divert all mail that goes to my friend including those sent to her as part of a group. I don't want to stop all mail that goes to an email that begins with "anne," for example. No problem, for usernames I know I don't use, I can just set up lines that contain: Apple Mail does not allow the use of wildcards in rules. Plus tons with numbers that start with the letter "x." These aren't just variations they're autogenerated and I see new ones regularly. For example, I discovered 3-4 fake usernames that start with "Anne." Ditto for multiple common names. any recipient contains recipient contains recipient contains recipient ends with problem comes with more randomly generated names. I can easily add them to one of my "junk" rules. I have no problem with fake usernames that end up on spammers' lists. I own several domain names and get endless spam to made-up or altered usernames on those domains. The latter are rules mostly to divert spam. I have a couple dozen rules within Apple Mail and some have hundreds of lines.
