type.inbound
and (
any(ml.nlu_classifier(body.current_thread.text).intents,
.name == "cred_theft" and .confidence == "high"
)
or any(ml.nlu_classifier(body.current_thread.text).entities,
.name == "org"
and .text in ("AAA", "Medicare Kit", "Blackstone Griddle")
)
or any(ml.nlu_classifier(body.current_thread.text).entities,
.name == "sender"
and (
strings.icontains(.text, "sam's club", "kobalt", "ace hardware")
or regex.icontains(.text, "lowe\'s.{0,10}reward")
)
)
or any(ml.nlu_classifier(body.current_thread.text).entities,
.name == "request"
and regex.icontains(.text, 'claim\s+your\s+(?:free|medical)?\s+kit')
)
or length(filter(ml.nlu_classifier(body.current_thread.text).entities,
.name == "financial"
and regex.icontains(.text, '\d{2}%\s*discount$')
)
) >= 2
)
and any(ml.nlu_classifier(body.current_thread.text).topics,
.name == "Advertising and Promotions" and .confidence != "low"
)
and any(ml.nlu_classifier(body.current_thread.text).entities,
.name in ("request", "org") and strings.icontains(.text, "survey")
)
and not (
sender.email.domain.root_domain in ("barracudanetworks.com")
and coalesce(headers.auth_summary.dmarc.pass, false)
)
// and the sender is not from high trust sender root domains
and not (
sender.email.domain.root_domain in $high_trust_sender_root_domains
and coalesce(headers.auth_summary.dmarc.pass, false)
)
Playground
Test against your own EMLs or sample data.