type.inbound
and any(filter(attachments, .file_extension =~ "msg"),
any(file.explode(.),
// payment request inside the embedded message
2 of (
regex.icontains(.scan.strings.raw,
'\b(?:ach|wire transfer|remit(?:ted|tance)?)\b'
),
strings.icontains(.scan.strings.raw, 'invoice'),
regex.icontains(.scan.strings.raw,
'payment discount|keep the discount|by (?:today|tomorrow|end of (the )?day)'
),
any(ml.nlu_classifier(.scan.strings.raw).topics,
.name == 'Request to View Invoice'
)
)
// newly registered domain referenced in the embedded message
and any(.scan.url.urls, network.whois(.domain).days_old < 30)
)
)
Playground
Test against your own EMLs or sample data.