EmailEngine has an optional feature to sync all emails to a local document store backend. Currently, only ElasticSearch can be used as such a backend.
EmailEngine supports ElasticSearch 8+. Older versions of ElasticSearch and otherwise compatible software like OpenSearch are not supported.
If the document store syncing is enabled, EmailEngine copies email contents for all new emails (excluding attachments) to ElasticSearch as email documents.
Whenever you request message listings or want to search for messages, EmailEngine would use ElasticSearch as the source of the data instead of the actual IMAP account. This approach has many upsides:
- ElaticSearch is not rate-limited. You can run as many requests as your servers can handle. With IMAP, you always need to consider that requests against a single email account can be processed serially, not in parallel, and each such request takes time.
- As the stored email document looks the same as what you'd get from the IMAP server with the message details API request, you can skip EmailEngine entirely and run your requests against ElasticSearch directly. This would enable aggregations and grouping that are not supported by EmailEngine natively.