Report abuse

mailman.rb (ruby_on_rails)

1
2
3
4
5
6
7
8
9
class Mailman < ActionMailer::Base
  def receive(email)
    # i just need emails with subjects
    unless email.subject.blank?
      EmailData.create({:subject => email.subject, :body => email.body})
      #do something with this email object
    end
  end
end

script/inbound.sh [shell-unix-generic]

1
2
#!/bin/bash
/usr/local/bin/ruby  /home/your_username/apps/your_app/current/script/runner -e production 'Mailman.receive(STDIN.read)'

setup an email address as your recipient and have it forward to: [shell-unix-generic]

1
|/home/your_username/apps/your_app/current/script/inbound.sh