Skip to content
Shantanu Sen Gupta
← All writing

Hereco | Behind Our Email Infrastructure: Amazon SES and Open-Source Mail Software

Hereco runs a hybrid email infrastructure combining Amazon SES with self-hosted open-source mail software. This architecture gives us control over mail transport and user mailboxes while using SES for reliable outbound email delivery. In this post, we explore how the different components work together to power Hereco’s email system.

Email is an important facet of running an online service. Sending out notifications, talking to users, and receiving messages are all important aspects of any such service.

At Hereco, we use Amazon SES with open source mail server software to power various aspects of our email infrastructure.

Instead of using a hosted mailbox solution or running everything ourselves, we use a combination of cloud email delivery and self-hosted open-source software to form our email infrastructure.

Amazon SES for Email Delivery

We use Amazon Simple Email Service (SES) to power our outbound email infrastructure.

In particular, we use Amazon SES to deliver emails from Hereco applications to external mail servers. This includes both application-generated email as well as other forms of messaging.

Using Amazon SES to deliver our emails means that we do not have to operate the entire email delivery infrastructure ourselves.

Open-Source Software for Mail Transport

The open-source mail server software we use serves as the intermediary between Hereco applications, our email infrastructure, and external mail servers.

It implements essential elements of the Simple Mail Transfer Protocol (SMTP) and is responsible for the transport of messages within our infrastructure.

For outgoing messages, our open-source mail server software works with Amazon SES to provide delivery of email to external mailboxes.

Our mail transport software implements the components necessary to accept, route, process, and deliver email messages. However, these components only extend so far as our own infrastructure. For the actual delivery of a message to an external mail server, we use Amazon SES.

The same software is also used to implement the incoming SMTP interface for our email infrastructure.

Open-Source Software for Mailbox Access

In addition to the transport of messages, we also use open-source software to provide access to user mailboxes.

This software implements the necessary components and interfaces to access the stored email messages. This includes standard access protocols such as Internet Message Access Protocol (IMAP).

In essence, the software provides the “user space” to our email infrastructure, while the open-source mail transport software implements the “server space”.

How the Pieces Fit Together

The various aspects of our email infrastructure are each necessary to fulfill our messaging needs.

For the transport of outgoing messages, an application can use our mail infrastructure to submit a message. The open-source mail transport software implements the SMTP interface and works with Amazon SES to deliver that message to an external recipient.

For the receipt of incoming messages, the SMTP interface implemented by our open-source software accepts the incoming message and delivers it to the appropriate mailbox.

In effect, each part of our email infrastructure has a particular job to do.

  • The open-source mail transport software handles the transport of messages within our infrastructure and beyond.
  • The open-source mail server software handles the access to the mailbox and the stored messages.
  • Amazon SES provides a managed delivery solution for our outbound messages.

In other words, it is a combination of self-hosted and managed email infrastructure that fulfills our requirements.

Image Demonstration of AWS SES

AWS SES Demonstration

Managing Email Reliability

The management of an email infrastructure involves more than just the transport of messages between users.

Authentication and reputation are a particularly important aspect of email delivery and infrastructure management. Configuring the domain, securing the SMTP interface, and setting up appropriate authentication and DNS records are all aspects of email infrastructure management.

In turn, we ensure that our email infrastructure is properly configured to maximize the chances that an email will be delivered to its intended recipient.

Why We Use This Architecture

The use of open-source software to implement our email infrastructure gives Hereco full control over the software and, by extension, our mailboxes.

At the same time, Amazon SES provides a fully managed email delivery service that we can use for our outbound messages. This way, we do not need to operate the entire email delivery infrastructure ourselves.

In other words, each component serves a specific purpose.

Open-source mail software handles the transport of messages, while open-source mailbox software handles the user space of our email infrastructure.

Amazon SES, meanwhile, provides a fully managed email delivery service that powers our outbound messages.

This combination serves to form a complete email system that we can use to send and receive emails while maintaining full control over our email infrastructure.

Email Infrastructure at Hereco

Our email infrastructure is another example of our infrastructure philosophy at Hereco: Use the right tool for the right job.

We do not use a single piece of software to handle all of our requirements because it is easier to scale and manage that way.

We find that it is easier to manage individual components when each has a specific purpose in the overall system. As a result, we can modify or replace individual components as necessary without affecting the rest of the system.

All the way down to the level of a single email, we make choices that make our system maintainable and manageable.