type.inbound
// there are less than 10 unique links for api.spently.com within the body.links
and length(distinct(filter(body.links, .href_url.domain.domain == "api.spently.com"), .href_url.url)) < 10
and any(body.links,
.href_url.domain.domain == "api.spently.com"
and strings.istarts_with(.href_url.path, '/api/spently/click')
and strings.icontains(.href_url.query_params, 'url=')
and strings.icontains(.href_url.query_params, 'type=')
and not regex.icontains(.href_url.query_params,
'url=(?:https?(?:%3a|:))?(?:%2f|\/){2}[^&]*spently\.com(?:\&|\/|$|%2f)'
)
)
and not sender.email.domain.root_domain == "spently.com"
// 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.