type.inbound
and (
any(ml.nlu_classifier(body.current_thread.text).entities,
.name == "org"
and .text in~ (
'AAA', // American Automobile Assoc.
'RAC', // UK Royal Automobile Club
'RAA', // Australia Royal Automotive Assoc.
'CAA', // Canadian Automobile Assoc.
'BCAA', // BC Automobile Assoc.
'AMA', // Alberta Motor Assoc.
)
)
)
and regex.icontains(body.current_thread.text,
'(?:car|vehicle|motor|driver|emergency|road.?side|break.?down|assist|save|discount|complimentary|free\b).{0,10}kit'
)
// 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)
)
// negate newsletters and quarantine notifications
and not (
any(ml.nlu_classifier(body.current_thread.text).topics,
.name in ("Newsletters and Digests") and .confidence != "low"
)
or strings.icontains(subject.subject, "quarantine")
)
Playground
Test against your own EMLs or sample data.