type.inbound
and any(attachments,
.file_extension == "mobileconfig"
and not strings.icontains(file.parse_text(.).text,
'<key>PayloadType</key>',
'<key>PayloadVersion</key>',
'<key>PayloadIdentifier</key>',
'<key>PayloadUUID</key>'
)
)
Playground
Test against your own EMLs or sample data.