type.inbound
// self sender
and (
sender.email.email == recipients.to[0].email.email
and not coalesce(headers.auth_summary.dmarc.pass, false)
)
// a hidden quoted reply header... we can use translate() lowercases
// and strip spaces so `DISPLAY:NONE` or `display: none` would both match
// https://developer.mozilla.org/en-US/docs/Web/XML/XPath/Reference/Functions/translate
and any(html.xpath(body.html,
'//*[contains(translate(@style, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", "abcdefghijklmnopqrstuvwxyz"), "display:none")]'
).nodes,
// outlook-style headers... long to/cc lists can sit between sent and subject
regex.icontains(.raw, 'From:.{0,1000}Sent:.{0,1000}Subject:')
)
and any(ml.nlu_classifier(body.current_thread.text).intents, .name != 'benign')
Playground
Test against your own EMLs or sample data.