type.inbound
and any(attachments,
(
.file_extension in~ ('ics')
or .content_type in ("application/ics", "text/calendar")
)
and not strings.icontains(beta.file.parse_ics(.).scale, 'GREGORIAN')
)
Playground
Test against your own EMLs or sample data.