Mailman::Rails

This gem helps you integrate ruby Mailman with Rails. It adds rake tasks to manage a mailman daemon and allows you to configure a Mailman::Application instance from within your models.

Installation

Add this line to your application's Gemfile:

gem 'mailman-rails'

And one of these lines depending on status of pull requests, versions etc:

gem 'mailman', :git => 'https://github.com/johncant/mailman'
gem 'mailman', :git => 'https://github.com/titanous/mailman'
gem 'mailman'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mailman-rails

Usage

Put your Mailman config in config/initializers/mailman.rb

Match Mailman stuff from your models:


class Post < ActiveRecord::Base # Or whatever

  Mailman::Rails.receive do
    to "[email protected]" do
      Post.create(JSON.parse(message.body))
    end
  end

  # The daemon would be started from the rake task but only after all the code is loaded.

end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request