type.inbound
and (
sender.email.email == 'office365alerts@microsoft.com'
or (
sender.email.domain.root_domain == 'microsoft.com'
and (
sender.email.domain.subdomain in (
'messaging',
'communication',
'accountprotection'
)
or regex.icontains(body.current_thread.text, 'ref:?\s*M365-[a-z]+-\d+')
)
)
)
and any(filter(body.current_thread.links, .href_url.scheme != 'mailto'),
regex.icontains(.href_url.url, '=\d{15,}', '[a-z]+%[a-z]{4,}')
or regex.imatch(.href_url.path, '/[a-z0-9+/]{40,}={0,2}')
or any([ml.link_analysis(., mode="aggressive")],
// CF Turnstile
any(.unique_urls_accessed,
.domain.domain == "challenges.cloudflare.com"
)
// or site is down behind Cloudflare
or (
regex.icontains(.final_dom.display_text,
'error\s*(?:code\s*)?(?:5\d{2}|1\d{3})'
)
and regex.icontains(.final_dom.display_text, 'cloudflare')
)
)
)
and not any(ml.nlu_classifier(body.current_thread.text).topics,
.name in ("Advertising and Promotions")
)
Playground
Test against your own EMLs or sample data.