While we all love services like Postmark and Mailgun on HN (and they are great services), does anyone know of any easy-to-setup open source projects that offer similar functionality? Traditional MTAs are a pain to setup and outdated to boot for webapps (mail parsing, signature and quote removal, UTF-8 transcoding, automatically updating spam detection, linkage to arbitrary storage handlers like MongoDB, and an HTTP+SSL JSON API should be a minimum).
I don't know if it provides precisely the functionality you're seeking, but Lamson was designed to address the need for an easier to setup, but still programmable and powerful mail system. It's designed to be able to use ORMs, databases, and data stores instead of text files as well.
Fantastic, thanks so much! It looks like it's almost there, and definitely something I will check out in more detail. Admittedly, my use case is limited, but as services like Mailgun and Sendgrid are demonstrating -- it is not an insignificant use case. Lamson looks like it's trying to achieve a bit more than that single case.
So a couple of things I noticed that might be missing from Lamson:
(1) Spam blocking auto-updates -- does this tap into Spamhaus, etc.?
(2) UTF-8 transcoding?
(3) Signature, quote stripping (like Mailgun).
(4) DKIM signing?
(5) Simple client libraries for sending mail (i.e., I don't want to build a "Lamson application", I just want to talk to a Lamson server on a privileged port using JSON).
Of course, all these concerns might have answers that I'm missing.
A bit more about my (fairly common, I'm guessing) use case: you have a VPS and a MongoDB instance. I want my MTA to take a minimal set of config parameters, say:
-- MongoDB database name
-- domain -> MongoDB table mapping
-- privileged API sending port
Now I want the MTA to receive mail for me, perform spam blocking, transcode to UTF-8, parse out signature and quotes in a separate field, and dump the whole object to a MongoDB document with the index field = the recipient's email address. I want it to auto-update it's spam blocking rules using whatever external services and internal analysis necessary. I want it to periodically dump some usage statistics into a separate MongoDB table (maybe a circular connection).
Now for sending mail, all I should have to do is connect to the privileged port from a process on the same machine (it's firewalled to the outside world), and submit an HTTP POST request that specifies recipients, message body, attachments, etc. The MTA should accept the request, perform whatever queuing, rate-limiting, and retrying is necessary to send the message.
All failures and diagnostic information are dumped to separate MongoDB tables. The applications deal with the database/storage system directly, to keep the MTA simple.
I'm glossing over a lot, naturally, but I hope that helps.
Be advised there are messages lamson will fail to deliver because it can't transcode them at the server (regardless of what clients support). I have the impression it can't even bounce them, though I'm not sure about that. It should be reliable among speakers of English and other ISO Latin languages.
Lamson isn't an open source alternative to mailgun and sendgrid per se, it's an open source alternative to writing your own library for email.
With that said, specific functionality is more a question of learning lamson, and tying in libraries that do do what you want, or finding someone that already has on Github.
For your use case, you would be tying together and implementing bits and pieces of this yourself. Part of the reason for Lamson existing is to enable programmers to solve their own problems with a common sensical base to work off of.
It's more of an equivalent to a web framework than a CMS.
If that isn't workable, you'll have to either hire somebody familiar with Lamson to hack it up for you, or you'll be at the mercy of existing plugins to tie an MTA into MongoDB. (Doesn't exist).
Do you have a more specific question for me to address? The answer to pretty much everything you brought up is "Cool, so go make it". The point of Lamson being the way it is, is so that you're not limited by the creator's intentions, just by your programming ability.