Advanced Criteria Script question

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

Advanced Criteria Script question

Post by scotty562 » Wed Jun 19, 2019 3:29 pm

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: 445
Joined: Fri Dec 30, 2005 1:27 pm

Re: Advanced Criteria Script question

Post by scngan » Fri Jun 28, 2019 5:51 pm

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

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

Re: Advanced Criteria Script question

Post by scotty562 » Tue Jul 02, 2019 12:14 pm

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: 224
Joined: Wed Nov 04, 2009 1:39 am
Contact:

Re: Advanced Criteria Script question

Post by kiamori » Mon Jul 08, 2019 6:58 pm

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