type.inbound
and strings.icontains(sender.display_name, ' ')
and any(html.xpath(body.html,
'//td[contains(@style, "background-color")]//a[@title and @href]'
).nodes,
// the leftover template title advertises a shopify file path...
any(regex.iextract(.raw,
'title="https://cdn\.shopify\.com(?P<tpath>/s/files/\d+/\d+/\d+/\d+/)'
),
// ...that the button's actual href doesn't point to
not any(..links,
.href_url.domain.domain == "cdn.shopify.com"
and strings.istarts_with(.href_url.path,
..named_groups["tpath"]
)
)
)
)
// negate highly trusted sender domains unless they fail DMARC authentication
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.