type.inbound
and any(attachments,
(
.file_extension in~ ('ics')
or .content_type in ("application/ics", "text/calendar")
)
and regex.icontains(file.parse_text(.).text, 'lambda-url')
)
Playground
Test against your own EMLs or sample data.