Advanced Criteria Script question

Discussion forum for Enterprise Edition.
Post Reply
scotty562
Posts: 23
Joined: Tue Sep 11, 2018 12:20 pm

Advanced Criteria Script question

Post by scotty562 »

I want to take all email that doesn't have .com, .net, or .org in it and send it to another email address. This is what I have so far, but this criteria never seems to get met and I'm not sure why.

Code: Select all

FilterResult=0 
if not CriteriaMet([ME_HEADERS_CONTAIN],"*.com") and not CriteriaMet([ME_HEADERS_CONTAIN],"*.net") and not CriteriaMet([ME_HEADERS_CONTAIN],"*.org") then
FilterResult=1
end if

scngan
Posts: 446
Joined: Fri Dec 30, 2005 1:27 pm

Re: Advanced Criteria Script question

Post by scngan »

did you add in "Actions" that will performed when the above criteria met ?

scotty562
Posts: 23
Joined: Tue Sep 11, 2018 12:20 pm

Re: Advanced Criteria Script question

Post by scotty562 »

Yes. The problem is the criteria doesn't seem to trigger. I still get emails from random domains coming through. Looks like I should be using ME_FROM instead.

kiamori
Posts: 329
Joined: Wed Nov 04, 2009 1:39 am
Contact:

Re: Advanced Criteria Script question

Post by kiamori »

You can't use and, you need to use or

Rule should be something like this:

Code: Select all

FilterResult=0
if not CriteriaMet([ME_HEADERS_CONTAIN],"*.com*") OR _
if not CriteriaMet([ME_HEADERS_CONTAIN],"*.net*") OR _
if not CriteriaMet([ME_HEADERS_CONTAIN],"*.org*") then
FilterResult=1
end if
but you may want to use [ME_FROM] instead.

I would probably do it like this:

Code: Select all

FilterResult=0
If not CriteriaMet([ME_FROM],"<REFERENCE><FILE>filtername.txt</FILE><PATH>Drive:\MEPATH\Config\Filters\Patterns</PATH><REFERENCE>") Then
FilterResult=1
End If
Then simply update your file with one TLD per line.

Post Reply