Skip to content

postalsys/emailengine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Sync users' emails with your service and send emails on their behalf.
  • Integrate your app with a dedicated email account, such as your support email.
  • Monitor INBOX and Junk folders of a test email account to track where sent emails land.
  • Ideal for lightweight webmail and mobile email apps that prefer to avoid direct IMAP and MIME processing.

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

  • Redis – Any version

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:

  • EmailEngine as a SystemD service
  • Caddy as a reverse proxy and HTTPS certificate handler
$ 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/arena.

  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.