EmailEngine Email API

EmailEngine is an email client for apps. IMAP and SMTP are hard, so let EmailEngine handle these for you. Run REST API calls to interact with email servers and receive webhooks for changes on tracked email accounts.

With EmailEngine, you can focus on building features that matter instead of spending time rolling custom IMAP and SMTP connectivity logic.

Screenshot 2022-12-20 at 11.13.35.png
EmailEngine - Access any email account to receive/send emails with an API | Product Hunt

Download

Get EmailEngine for your system

Quickstart

EmailEngine is a self-hosted email automation platform. It provides access to email accounts via an easy-to-use HTTP REST API to receive and send emails. EmailEngine actively monitors these accounts and sends a webhook any time something happens.

  1. See installation instructions for your system here.
  2. Run EmailEngine from the command line:
$ emailengine
  1. Open http://127.0.0.1:3000 in your browser and activate a free 14-day trial
  2. Next, generate an access token and use it on the API Reference page to try out some API calls

Alternative to rolling your own

EmailEngine saves you a ton of developer hours as there is no need to figure out the complexities of email protocols.

It's a wise choice if you plan to build IMAP and SMTP integrations in-house and are not interested in the subtle details of a boatload of RFC specs. EmailEngine is like an email class library but on steroids.

Full control
Own the stack
Complexity hidden away

Easy to use REST API

The REST API with JSON payloads you expect it to be. No need to know IMAP internals, weird encodings, or juggle with different IMAP extensions.

Unicode strings
Binary attachments
Paged listings

Webhooks support

EmailEngine sends you a webhook any time something happens on the user's email account.

Incoming emails
Deleted emails

Almost perfect deliverability

EmailEngine sends emails through the user's email servers, so for the recipient, it seems that the email came from the user directly and not via some third-party sending service.

Uploads to Sent Mail
Adds reference headers
Bounced email detection
Stored MJML templates

Fluent OAuth2

EmailEngine can speak OAuth2 fluently with Gmail and Outlook servers. You can also choose to manage token renewals yourself, or you can let EmailEngine handle everything.

Hosted authentication

Redirect your users to EmailEngine's hosted authentication form, and once the email account is authorized, the user is sent back to your app.

You can still use API calls to register accounts without redirecting users to EmailEngine's UI; hosted authentication makes the process slightly easier to set up while developing.

IMAP/SMTP
Gmail
Outlook

Look under the hood

Multiple logging options, including full IMAP transactions for debugging.

Full transaction logs
Per-user logs
Screenshot 2022-10-19 at 11.57.33.png

Low-code integrations

Create custom webhook routes by defining filter functions and output mappers. Turn any event into a chat message in Slack or Discord, or send that data to Zapier for further processing.

Local indexing

Sync all emails to ElasticSearch for faster API response times and data mining options.

ElasticSearch
Fast updates
Screenshot-2022-05-28-at-00.11.47.png
Screenshot 2022-04-16 at 14.17.09.png

Monitoring

EmailEngine exposes a Prometheus metrics collection endpoint for easier monitoring.

Grafana
Prometheus

FAQ

Who is it for?

Anyone who wants to integrate their system with existing email accounts. For example a help desk service that runs on top of support@domain.tld account and converts incoming emails to support tickets.

How does it work?

EmailEngine keeps an open IMAP connection against every registered email account and listens to changes on these accounts. Also, whenever you request some action over the API, EmailEngine "translates" that request into an IMAP command.

Do I need a license key?

You can activate a 14-day free trial straight from the dashboard. Once the trial license expires, EmailEngine stops processing IMAP accounts until you provide a valid commercial license.

Do I need to pay for multiple licence keys?

In general, no. You would pay not for EmailEngine, the software, but Postal Systems' yearly subscription. If your subscription is valid, you can generate as many license keys as you wish without any additional cost.

What are the requirements?

EmailEngine uses Redis as the caching database. That's about it. If you have any decently recent version of Redis installed, then you are good to go. Ensure to keep the latency between Redis and EmailEngine as low as possible to improve the performance.

Which kind of protocols are supported?

EmailEngine uses IMAP to access mailboxes and SMTP to send out emails. Alternative protocols like POP3, ActiveSync, or the Exchange Web Services (EWS) SOAP API are not supported but might be in the future.

What about data compliance?

EmailEngine is self-hosted and not an external service, so it does not send or store data outside your network. It only keeps minimal metadata required for syncing and caches but not the actual contents of the emails.

Can I run multiple EmailEngine instances that share the same Redis database?

At this point, unfortunately, no. Horizontal scaling is on the roadmap but without an ETA.

I'm getting a lot of 504 errors for API calls

IMAP is a single-threaded protocol which means that you can only run a single command at a time per account and have to wait until it finishes before you can issue another command. So if you make multiple API requests against a single account at the same time then EmailEngine queues these requests and processes these in order, one command at a time, while other queued commands will wait their turn. If a queued command can not be processed in 10 seconds, then EmailEngine aborts it with the 504 response.

You have two choices, either do not send multiple requests at the same time or increase that 10-second limitation. Look for the "Max command duration" option in the configuration options documented here.

Is it the same as Nylas Universal Email API?

You can read about the differences here. In short, both seem alike but, in fact, are pretty different.

I have a different question

You can ask anything in the EmailEngine's Discord channel.