adzap / ar_mailer Goto Github PK
View Code? Open in Web Editor NEWfork of ar_mailer gem by Eric Hodel that allows deferred batch sending of emails for Rails apps
Home Page: http://seattlerb.rubyforge.org/ar_mailer/
License: Other
fork of ar_mailer gem by Eric Hodel that allows deferred batch sending of emails for Rails apps
Home Page: http://seattlerb.rubyforge.org/ar_mailer/
License: Other
I set another class in initializer and when ar_sendmail is run I got Unhandled exception undefined method `email_class=' for ActionMailer::Base:Class(NoMethodError):
No idea why this happens and I can't find anything online except a reference to it in a closed lighthouse account.
action_mailer/ar_sendmail.rb:379:in deliver' /opt/ruby-enterprise/lib/ruby/1.8/net/smtp.rb:526:in
start'
/home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:374:in deliver' /home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:462:in
run'
/home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:458:in loop' /home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:458:in
run'
/home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:296:in run' /home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/bin/ar_sendmail:5 /opt/ruby-enterprise/bin/ar_sendmail:19:in
load'
/opt/ruby-enterprise/bin/ar_sendmail:19
Unhandled exception undefined method success?' for "200 dummy reply code":String(NoMethodError): /opt/ruby-enterprise/lib/ruby/1.8/net/smtp.rb:929:in
check_response'
/opt/ruby-enterprise/lib/ruby/1.8/net/smtp.rb:899:in getok' /opt/ruby-enterprise/lib/ruby/1.8/net/smtp.rb:899:in
getok'
/home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:16:in reset' /home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:396:in
deliver'
/opt/ruby-enterprise/lib/ruby/1.8/net/smtp.rb:526:in start' /home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:374:in
deliver'
/home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:462:in run' /home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:458:in
loop'
/home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:458:in run' /home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:296:in
run'
/home/mtmadmin/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.8/bin/ar_sendmail:5
/opt/ruby-enterprise/bin/ar_sendmail:19:in `load'
/opt/ruby-enterprise/bin/ar_sendmail:19
Hi,
ar_sendmail suddenly stopped working on my development machine, reporting:
Unhandled exception undefined method `version_requirements=' for #<Gem::Dependency:0x10143a5d8>(NoMethodError):
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/gem_dependency.rb:224:in `specification'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `plugins'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `inject'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `inject'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `plugins'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/loader.rb:63:in `locate_plugins'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/loader.rb:62:in `map'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/loader.rb:62:in `locate_plugins'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/loader.rb:27:in `all_plugins'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/loader.rb:22:in `plugins'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/loader.rb:45:in `add_plugin_load_paths'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:269:in `add_plugin_load_paths'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:135:in `process'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `send'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `run'
./config/environment.rb:19
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/local/lib/ruby/gems/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:252:in `process_args'
/usr/local/lib/ruby/gems/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:250:in `chdir'
/usr/local/lib/ruby/gems/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:250:in `process_args'
/usr/local/lib/ruby/gems/1.8/gems/adzap-ar_mailer-2.1.8/lib/action_mailer/ar_sendmail.rb:269:in `run'
/usr/local/lib/ruby/gems/1.8/gems/adzap-ar_mailer-2.1.8/bin/ar_sendmail:5
/usr/local/bin/ar_sendmail:19:in `load'
/usr/local/bin/ar_sendmail:19
My configuration:
Ruby 1.8.7-p174
local gems:
adzap-ar_mailer (2.1.8, 2.1.7, 2.1.6, 2.1.5)
environment.rb:
RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
config.action_mailer.delivery_method = :activerecord
config.gem "adzap-ar_mailer"#, :lib => 'action_mailer/ar_mailer', :source => 'http://gems.github.com'
(I've tried config.gem ... :version => ... for all of the four versions of adzap-ar_mailer I have, it didn't help)
production.rb:
ActionMailer::Base.template_root = "/home/carebees/apps/carebees/current/app/views"
require 'action_mailer/ar_mailer'
Thanks,
martin
When I start in passenger, I get the error:
Expected /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/adzap-ar_mailer-2.1.5/lib/action_mailer/ar_mailer.rb to define ActionMailer::ARMailer
It looks like that file defines ActionMailer::Base instead of ARMailer as the original ar_mailer plugin.
If I change that to define class ActionMailer::ARMailer < ActionMailer::Base, I get past that error but then get an email_class error when running ar_sendmail. It looks like that is hardcoded to ActionMailerBase but if I change that to ActionMailer::ARMailer then everything works.
Is this a problem with this version or is it something to do with my install setup?
I have my config/environment.rb like this :
config.gem "adzap-ar_mailer", :lib => 'action_mailer/ar_mailer', :source => 'http://gems.github.com'
when i run ar_sendmail i have this error :
Unhandled exception undefined method
email_class' for ActionMailer::Base:Class(NoMethodError):
/github/radiant3/vendor/rails/actionmailer/lib/action_mailer/base.rb:400:in method_missing' /home/pierre/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.1/lib/action_mailer/ar_sendmail.rb:340:in
initialize'
/home/pierre/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.1/lib/action_mailer/ar_sendmail.rb:300:in new' /home/pierre/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.1/lib/action_mailer/ar_sendmail.rb:300:in
run'
/home/pierre/.gem/ruby/1.8/gems/adzap-ar_mailer-2.1.1/bin/ar_sendmail:5
/opt/ree/bin/ar_sendmail:19:in load' /opt/ree/bin/ar_sendmail:19
Is this not working with rails 3?
[~/km/sio/trunk]$ bundle exec ar_sendmail --create-migration
Unhandled exception undefined method `classify' for "Email":String(NoMethodError):
/Users/daniel/.rvm/gems/ruby-1.9.2-p0/gems/ar_mailer-1.5.1/lib/action_mailer/ar_sendmail.rb:125:in `create_migra
tion'
/Users/daniel/.rvm/gems/ruby-1.9.2-p0/gems/ar_mailer-1.5.1/lib/action_mailer/ar_sendmail.rb:369:in `run'
/Users/daniel/.rvm/gems/ruby-1.9.2-p0/gems/ar_mailer-1.5.1/bin/ar_sendmail:5:in `<top (required)>'
/Users/daniel/.rvm/gems/ruby-1.9.2-p0/bin/ar_sendmail:19:in `load'
/Users/daniel/.rvm/gems/ruby-1.9.2-p0/bin/ar_sendmail:19:in `<main>'
I noticed that for time to time ar_sendmail daemon (/etc/init.d/ar_sendmail) shut down for no reason - or maybe there is a reason, but it has no logs, so I don't know why.
By default, Postfix returns a 450 when the sending email address fails a DNS lookup such as the following:
#<Net::SMTPServerBusy: 450 4.1.8 <[email protected]>: Sender address rejected: Domain not found
While I agree that under normal circumstances it would be wise to stop sending should the external server actually be overloaded, in this case, none of the other emails that have been queued behind the offending email will ever be sent. As well, the error message of "server too busy, stopping delivery cycle" isn't accurate and is misleading.
Would it be possible to handle SMTPServerBusy exceptions just like Net::SMTPUnknownError, Net::SMTPSyntaxError, TimeoutError, Timeout::Error which just logs an error and continues on?
When including BCC addresses in my mailer actions, and sending via ar_mailer, a couple interesting things happen:
emails
table, BCC'd to the additional address, an email record is created for each recipient. I'm no expert on the inner workings of email delivery so I don't know if this accurately represents how BCC'd emails are actually handled (but I suspect it's not).I've created a simple Rails 2.3.5 application to isolate the issue. I'm running Ruby 1.8.7-174 and the latest adzap-ar_mailer (2.1.7). I'll zip it up and email it your way, Adam. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.