public
Description: email => [http post, jabber]
Homepage: http://oss.techno-weenie.net/discussions/astrotrain
Clone URL: git://github.com/entp/astrotrain.git
name age message
file .gitignore Thu Sep 17 20:03:56 -0700 2009 add astrotrain gem [technoweenie]
file LICENSE Thu Oct 16 21:00:16 -0700 2008 add license and readme [technoweenie]
file README Thu Sep 03 10:05:11 -0700 2009 update docs [technoweenie]
file Rakefile Loading commit data...
file VERSION
file astrotrain.gemspec
directory config/ Wed Sep 02 23:32:18 -0700 2009 add api for checking the contents of the queue [technoweenie]
directory lib/
directory tasks/ Fri Nov 21 16:18:42 -0800 2008 update merb support files [technoweenie]
directory test/
README
astrotrain
==========

Scans incoming emails for mapped recipients and sends an HTTP POST somewhere.

  # setup a config file.
  # Point the queue_path at a directory that your mail server dumps each raw incoming mail.
  require 'astrotrain'

  Astrotrain.load path do
    DataMapper.setup(:default, {
      :adapter  => "mysql",
      :database => "astrotrain",
      :username => "root",
      :host     => "localhost"
    })
  end
  Astrotrain::Message.queue_path = "/path/to/maildir"
  Astrotrain::Mapping::Transport.processing = true

  # start up IRB
  irb -I /var/astrotrain/lib -r config.rb

  # manage mappings
  LIB=/var/astrotrain/lib CONFIG=config.rb rake at:mappings
  LIB=/var/astrotrain/lib CONFIG=config.rb rake at:map EMAIL=support@foo.com DEST=http://foo.com/email
  LIB=/var/astrotrain/lib CONFIG=config.rb rake at:unmap MAP=123

  # start the server that runs over the queue directory
  LIB=/var/astrotrain/lib CONFIG=config.rb rake at:process

  # start the sinatra API
  ruby -I /var/astrotrain/lib /var/astrotrain/lib/astrotrain/api.rb config.rb

A single Astrotrain process currently handles email for two production applications, processing thousands daily.
It's far from perfect, but definitely usable.

TODO
====

Gem package - I realize the load paths could be simplified a bunch, so a gem package will come soon.
Docs
bounced emails