type.inbound
and length(filter(attachments, .file_type == "pdf")) >= 1
and any(html.xpath(body.html, '//div[span/b and span/following-sibling::span]').nodes,
length(distinct(regex.extract(.raw, 'rgb\(.*?\)'), .full_match)) == 2
and any(html.xpath(., './/span').nodes,
regex.contains(.inner_text, 'following (code|password|pass):$')
)
)
Playground
Test against your own EMLs or sample data.