Wednesday, December 09, 2009

emsuite - Emidln's Mail Suite

Over the last few months I've increasingly wished for a mail server that could store everything in a SQL database. I searched for such a solution using Sendmail and Postfix to varying degrees of success. dbmail seemed to be the best solution available, but its configuration was neither elegant nor easy. The web-based tool provided left me wanting something else and the way users were handled didn't seem very intuitive. Nothing else in the open-source realm seems to approach dbmail in quality so I came into the idea of writing my own.

I've been toying around with Twisted for a few years now with some medium-sized projects using twisted.words, twisted.web, and twisted.conch to simplify various tasks. From this past experience, I knew an api existed for SMTP/ESMTP/IMAP/POP3 and I'm decently comfortable with Twisted so I started there first.

I've been reading, rereading, and prototyping several mail servers over the last month based on twisted. I finally came into a database schema that I liked, an authentication model that I can live with, and a couple neat features for my mail server. Most importantly, all of the key features I need from a mail server were relatively painless to steal from twisted or implement on top of it:

- Database-backed mail storage, authentication, and full virtualization for users/aliases/domains
- SMTP AUTH over TLS to allow secure external relaying
- Spamlist processing for whitelists/blacklists
- Easy quota system for users and domains
- IMAPv4 over SSL support

Some side effects of rolling my own database-backed mail system:

- separation of headers, body text, and mime attachments for optimized storage
- fast full-text search of emails for users and designated individuals for entire groups or domains.
- one backup operation: everything, configuration to data is stored inside a db
- failover support via MySQL clustering
- customized usage reports per user, group, or domain
- more featureful webmail client that can bypass the limitations of IMAP and POP3

I'm excited about an upcoming code release on If you're interested in the code, leave me a message. Otherwise, check back here for updates.

No comments:

Post a Comment