type.inbound
and any(filter(body.current_thread.links,
regex.icontains(.display_text,
'(?:REF|S?RF[PQI]|BID|PROP)(?:-(?:[A-Z][0-9][A-Z][0-9]|[A-Z]{2}[0-9]{2})){2}'
)
),
.href_url.domain.root_domain != sender.email.domain.root_domain
)
and not (
sender.email.domain.root_domain in $high_trust_sender_root_domains
and coalesce(headers.auth_summary.dmarc.pass, false)
)
Playground
Test against your own EMLs or sample data.