Elastic

Message read and write throughput scales linearly as more nodes added.

Underlying components – Cassandra and Blob Stores also can scale linearly to thousands of nodes.

Decentralized

ElasticInbox itself was designed with “share-nothing” architecture in mind where every node is independent. This means no single point of failure.

Cassandra and Blob Stores are also decentralized.

Fault Tolerant

ElasticInbox stores information in Cassandra and Blob store. Both technologies provide automatic replication to multiple nodes. Both support replication across multiple data centers. Failed nodes, whether it’s ElasticInbox, Cassandra or Blob store, can be replaced with no downtime.

Architecture

Diagram below depicts sample architecture:

ElasticInbox Architecture

Why ElasticInbox?

Typical email delivery process involves a number of components:

  • Mail User Agent (MUA) – e.g. Mozilla Thunderbird, Microsoft Outlook
  • Mail Transfer Agent (MTA) – e.g. Postfix, Exim
  • Mail Delivey Agent (MDA) – ElasticInbox
  • IMAP, POP3, and other interfaces to access mail

MDA is responsible for storing messages. Most of the existing MDAs (or sometimes MTAs) store messages only on the locally mounted filesystem which is sufficient when you have few thousands of accounts. However, when you need to serve millions of accounts, local filesystem is not an option.

Solution

ElasticInbox MDA can serve millions of accounts and scale linearly – no bottlenecks, no single point of failure, multiple replicas provide fault tolerance. This is perfect solution if you run on the private or public cloud – just add more nodes as you grow. Messages are delivered over the standard LMTP protocol.

In addition to MDA, ElasticInbox also supports RESTful interface for managing, retrieving and storing messages. It provides an easy way for building web services (such as webmail, admin panel, etc.) on top of ElasticInbox. See some examples below.

We also plan to port one or more existing POP3 and IMAP servers to work with ElasticInbox. See roadmap for the full list of planned features.

REST API

This is very simple example showing how you can store and retrieve message form ElasticInbox:

1. Initialize new account:

curl -XPOST "http://localhost:8181/rest/v1/user@mydomain.tld"

Response:

HTTP/1.1 201 Created
Location: http://localhost:8181/rest/v1/user@elasticinbox.com/mailbox

 

2. Store message in the Inbox (Label=1)

curl -XPOST "http://localhost:8181/rest/v1/user@mydomain.tld/mailbox/message?label=1" \
     -T testmail.eml

Response:

HTTP/1.1 201 Created
Location: http://localhost:8181/rest/v1/user@mydomain.tld/mailbox/message/e5031a10-f81d-11df-a88e-080027267700

{"id":"e5031a10-f81d-11df-a88e-080027267700"}

 

3. Get pre-parsed message (served from Cassandra):

curl -XGET \
    "http://localhost:8181/rest/v1/user@mydomain.tld/mailbox/message/e5031a10-f81d-11df-a88e-080027267700"

Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "message": {
        "labels": [0, 1],
        "size": 1123,
        "date": "2010-11-24T22:55:12.000+0000",
        "subject": "Hello World!",
        "uri": "blob://aws-s3/e5031a10-f81d-11df-a88e-080027267700",
        "from": [{
                "address": "test@elasticinbox.com",
                "name": "John Doe" }],
        "to": [{
                "address": "user@mydomain.tld",
                "name": "My Name" }],
        "htmlBody": "This is sample <u>html</u> message body.<br><br>-- EI<br>"
    }
}

 

4. Get raw message (served from blobstore):

curl -XGET \
    "http://localhost:8181/rest/v1/user@mydomain.tld/mailbox/message/e5031a10-f81d-11df-a88e-080027267700/raw"

Response:

HTTP/1.1 200 OK
Content-Type: text/plain
Transfer-Encoding: chunked

Received: from mx02 (mx02 [127.0.0.1])
        by mx02 (Postfix, from userid 48)
    id AB80628CA95; Mon, 05 Dec 2011 09:53:50 -0800 (PST)
Date: Mon, 5 Dec 2011 21:53:48 +0400
To: =?utf-8?B?w4dhdGTEsXLEsWxtYWzEsSDDnG52YW4=?= <user@mydomain.tld>
From: =?utf-8?B?UsO8c3TJmW0gxo9saXlldg==?= <test@elasticinbox.com>
Subject: =?utf-8?B?VVRGOCBUZXN0IMO8w6fDvG4gbcO2dnp1IGZpa2lsyZnFn23JmW1pxZ/JmW0=?=
Message-ID: <3917ea5a412bc64e0c1f04d81ac2e5c6@elasticinbox.com>
...

For the complete REST API documentation visit api.elasticinbox.com.