type.inbound
and (
regex.icontains(sender.display_name,
'^sam(?:\.gov\b|\s(?:renew|compliance))',
'final\ssam\.gov',
'^sba[\s-]?(?:e[fd]|\.gov)',
'^sba[\s-](?:connect|invoice|admin|eidl)\b',
'^sba[\s-]support[\s-]\w+'
)
or (
strings.icontains(body.current_thread.text, 'sam.gov')
and any(html.xpath(body.html, '//img/@src').nodes,
strings.icontains(.raw, 'sam%20renew%20entity')
)
)
)
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.