type.inbound
and any(body.links,
// contains bit.ly link
.href_url.domain.root_domain == "bit.ly"
// link doesn't forward through
and ml.link_analysis(.).effective_url.domain.domain == "bit.ly"
// blocked or gated by bit.ly
and strings.ilike(ml.link_analysis(.).final_dom.display_text,
"*link*blocked*",
"*flagged*by*"
)
)
// negate highly trusted sender domains unless they fail DMARC authentication
and (
(
sender.email.domain.root_domain in $high_trust_sender_root_domains
and not headers.auth_summary.dmarc.pass
)
or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)
and (
not profile.by_sender().solicited
or (
profile.by_sender().any_messages_malicious_or_spam
and not profile.by_sender().any_messages_benign
)
)
and not profile.by_sender().any_messages_benign
Playground
Test against your own EMLs or sample data.