Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I’m unsure

CouchDB Mailer extension

After the launch of the billing system, the SSL and Lucene support, could be the CouchDB Mailer extension the next hosting feature?
6 people have
this question
+1
Reply
  • EMPLOYEE
    I’m excited
    Love it!

    Are you talking about a specific *existing* project? Or is it a hypothetical mailer with an obvious feature set (send email)?

    CouchDB documents are already little state machines. They have a state (the current revision), and they can transition to a new state (a document update) only one at a time, thanks to MVCC.

    Therefore, what I would *love* is a super-simple spec describing a super-simple email workflow of a Couch document. For example:

    { "_id": "abcd1234"
    , "type": "couchmail"
    , "state": "outgoing"
    , "modified_at": "2011-05-11T15:16:44.600Z"
    , "headers": { "To": "Jason Smith ", "etc...":"etc" }
    , "body": "Email body goes here"
    }

    Maybe the next state is "sending" and the final state is "sent"? Once the workflow makes sense, we (Iris Couch and the community) could build a free software processor in NodeJS (or any other language, but Javascript seems convenient).

    With all that done, users can run their *own* email gateway, using free NodeJS cloud hosting, or running on their own computer. Or Iris could run it ourselves if it made sense. That lets couch do what it does best (store the emails, map/reduce queries of the emails, sync to or from another couch (maybe one that was offline before).
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • Hi,

    I'm talking about an existing project: https://github.com/jri/couchdb-mailer.
    It uses an external Java process with CouchDB4J (not very convenient), a post request to a "_mailer" httpd_db_handler and a "success" response (not exactly a state machine :)).

    Do you think is possible build a more elegant solution based on your specification with a "document update handler" and a NodeJS mailer https://github.com/marak/node_mailer?

    -Mariano
    • couchdb-mailer is very elegant! However as you said, it will be difficult to integrate this into Iris since we are trying very hard to stick to orthodox Apache CouchDB as much as possible.

      In general, I love the idea of storing a request queue of tasks to perform (send an email, send an SMS, spider a URL) and then have two clients communicate via the couch about the status of the task.

      Then for the popular services, Iris can either run those clients as a favor, or allow third-parties to do it for you using OAuth.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • I’m excited
    Jason, your idea describes *exactly* what I'd love to have as well. I'd build it anyway myself this way, but if you'd build it yourself, it would be even better, because lots of other people would benefit from it.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • Jason, you nailed it. I want to build app-in-database completely and that's the last piece needed, I think. 1 cent per message sent? :)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated