type.inbound
and (
strings.ilike(sender.display_name, '*spotify*')
or strings.ilevenshtein(sender.display_name, 'spotify') <= 1
or strings.ilike(sender.email.domain.domain, '*spotify*')
)
and sender.email.domain.root_domain not in~ (
'spotify.com',
'byspotify.com',
'echosign.com',
'fromspotify.com',
'anchor.fm'
)
and sender.email.domain.domain not in~ ('privaterelay.appleid.com')
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
)
)
// 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
)
Playground
Test against your own EMLs or sample data.