[Backgroundrb-devel] backgroundrb / actionmailer / sendmail

Adam Kapelner kapelner at gmail.com
Fri May 2 22:20:16 EDT 2008


Hello,

I'm trying to send emails from a backgroundrb worker and the email doesn't
send. I get no log messages in the sendmail log or the system log, nothing
in the backgroundrb logs at all, nothing in the production log.

Below is my code for each component

worker:

class QuizReviewerWorker < BackgrounDRb::MetaWorker
  set_worker_name :quiz_review_sender

  def create(args = nil)
  end

  def send_review_emails
    mail = Notifier.create_test_email
    status = Notifier.deliver(mail)
    logger.info 'test mail:' + mail.body
  end
end

mailer:

class Notifier < ActionMailer::Base

  def test_email
    recipients 'kapelner at gmail.com'
    subject 'test email'
    body 'body of email'
    content_type "text/plain"
  end
end

backgroundrb configuration:

---
:backgroundrb:
  :ip: 0.0.0.0
  :port: 11006
  :environment: production
  :debug_log: true
:schedules:
  :quiz_review_sender:
    :send_review_emails:
      :trigger_args:
        :start: <%= Time.now + 30.seconds %>
        :end: <%= Time.now + 10.years %>
        :repeat_interval: <%= 20.seconds %>

environment.rb configuration:

ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_content_type = 'text/html'


Now, when doing the request from rails itself, no problem, I get the email
instantly. Here's the controller code:

class MiscellanyController < ApplicationController
  def test_email
    mail = Notifier.create_test_email
    Notifier.deliver(mail)
    render :text => mail.body
  end
end


What could be the issue? I'm using Ruby 1.8.6, Rails 1.2.5, on Fedora Core
6, Backgroundrb (last updated 2008-02-28)

thanks so much,
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080502/262655b2/attachment-0001.html>


More information about the Backgroundrb-devel mailing list