postalsys / emailengine

Headless email client
https://emailengine.app/
Other
1.9k stars 168 forks source link

EmailEngine Logo

EmailEngine Email API

A headless email client application that provides access to IMAP, SMTP, Gmail API, and MS Graph API resources via a unified REST API. Easily integrate email accounts with your service!

Use Cases

Quickstart

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3

Version and License

Run the following command to check the version and license information for both EmailEngine and its included modules:

$ emailengine license

Requirements

[!NOTE] While Redis does not officially support Windows, alternatives like Memurai are available.

[!TIP] Minimize the latency between EmailEngine and Redis by running both on the same machine or in the same data center. Since EmailEngine runs a separate Redis command for each message in a folder during syncing, high latency can lead to slow sync times for folders with many messages.

Documentation

Configuring EmailEngine

Refer to the configuration documentation for details on setting up EmailEngine.

App Access

By default, EmailEngine only allows connections from localhost. To enable external access, either edit the config file or use the CLI option --api.host="0.0.0.0". Ensure to secure external access with a firewall or proxy to allow only trusted sources.

Deployment

Ubuntu or Debian

You can use the included install script to set up:

$ wget https://raw.githubusercontent.com/postalsys/emailengine/master/install.sh
$ chmod +x install.sh
$ ./install.sh example.com

Where example.com is the domain name for EmailEngine.

[!NOTE] Tested on Ubuntu 20.04 and Debian 11. Other versions may not be supported.

SystemD

Learn more about running EmailEngine as a SystemD service here.

Docker

Docker Image Size

To execute EmailEngine-CLI commands within a Docker container:

  1. Exec into the container:

    $ docker exec -it <container-id> /bin/sh
  2. Run commands using ./bin/emailengine.js:

    $ node bin/emailengine.js <command>

For full Docker usage documentation, visit here.

Resolving Issues with Redis

EmailEngine relies on Redis as its data store. Redis stores everything in RAM, so if an issue arises, EmailEngine may flood Redis, rendering the app unusable if space runs out.

To diagnose problems:

  1. Check Bull Queues: Use the built-in Bull Arena UI to monitor queue states at http://127.0.0.1:3000/admin/bull-board.
  2. Scan Keyspace: Run the following to group Redis keys by type and generate a report:

    $ emailengine scan > keyspace.csv

Monitoring

EmailEngine provides Prometheus metrics, available at the /metrics URL path.

Log Analysis

For information on logging options, read the documentation here.

To trace IMAP traffic for a specific account, use the following command:

$ npm run raw -- --filter.account=account1

Security and Data Compliance

For detailed security and data compliance information, refer to this guide.

Licensing

EmailEngine is licensed under the commercial EmailEngine License.