diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-20 17:42:33 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-20 17:42:33 +0000 |
commit | 425aa50a902658d04037b6dd45fa81ecb478fefb (patch) | |
tree | 9601687d2d47da46c3196fc073615b0d3c636654 /actionmailer | |
parent | 2afb8a8cc0e3562d22a5ea31b934e076b5bfe8f6 (diff) | |
download | rails-425aa50a902658d04037b6dd45fa81ecb478fefb.tar.gz rails-425aa50a902658d04037b6dd45fa81ecb478fefb.tar.bz2 rails-425aa50a902658d04037b6dd45fa81ecb478fefb.zip |
Added receiver method for incoming email
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@940 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index ab17874fd8..8661f44702 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -114,7 +114,7 @@ module ActionMailer #:nodoc: rescue Object => e raise e if raise_delivery_errors end - end + end end def mail(to, subject, body, from, timestamp = nil, headers = {}, @@ -150,6 +150,11 @@ module ActionMailer #:nodoc: "=?#{charset}?Q?#{text}?=" end + def receive(raw_email) + logger.info "Received mail:\n #{raw_email}" unless logger.nil? + new.receive(TMail::Mail.parse(raw_email)) + end + private def perform_delivery_smtp(mail) Net::SMTP.start(server_settings[:address], server_settings[:port], server_settings[:domain], |