Open
Description
Is your feature request related to a problem? Please describe.
- I want to be able to filter for emails with attachments.
- I want to be able to filter for emails with specific attachments (e.g. based on file name or file extension).
Describe the solution you'd like
schema:Email AND properties.attachments:*
should return all emails that have any attachment.schema:Email AND properties.attachments:*.pdf
should return all emails that have an attachment ending with.pdf
.
Describe alternatives you've considered
- Searching for
properties.mimeType:multipart/mixed
might help narrowing down the list of emails, but every email that has HTML and plaintext alternatives will also be included by this even if it doesn’t have any attachments.
Additional context
- Email attachments are separate entities that have a reference to the email, but there’s no efficient way to run joins in ES.
- An easy solution probably would be to add the file names of attachments to the
Email
entity itself, e.g. in a newattachments
property. This wouldn’t allow queries for arbitrary attachment properties, but likely cover many use cases.