type.inbound
and length(attachments) > 0
// 3 instances of zip/encrypted/payment information
and 3 of (
regex.icontains(body.current_thread.text, 'zip file.{1,50}encrypted'),
regex.icontains(body.current_thread.text, 'attachment.{1,30}encrypted'),
regex.icontains(body.current_thread.text,
'password.{1,5}is.{1,5}[A-Z0-9]{8,}'
),
regex.icontains(body.current_thread.text,
'details.{1,20}payment.{1,30}attach'
),
strings.icontains(subject.subject, "you have received"),
strings.icontains(subject.subject, "new debit"),
strings.icontains(subject.subject, "payment confirmation"),
strings.icontains(subject.subject, "invoice attached")
)
and (
// one attachment included and the file is a zip
attachments[0].file_extension == "zip"
and (
regex.icontains(attachments[0].file_name,
'payment|invoice|receipt|document|bank'
)
// long uppercase passwords
or regex.contains(body.current_thread.text, '[A-Z]{10,}')
)
)
Playground
Test against your own EMLs or sample data.