type.inbound
and any(regex.iextract(body.html.raw, 'cid:([a-f0-9]{16,})\.\d{1,3}@'),
length(filter(html.xpath(body.html, '//img/@src').nodes,
strings.icontains(.raw, ..groups[0])
)
) >= 4
)
Playground
Test against your own EMLs or sample data.