type.inbound
and any(body.links,
.href_url.domain.domain == "script.google.com"
and strings.ilike(.href_url.path, "/macros*")
)
and (
profile.by_sender().prevalence in ("new", "outlier")
or (
profile.by_sender().any_messages_malicious_or_spam
and not profile.by_sender().any_messages_benign
)
)
Playground
Test against your own EMLs or sample data.