Rails 3: Trying to extend Action Mailer with a module
问题 Trying to rewrite an old alias_method_chain to add a filter on outgoing emails, and it isn't working. I'm pretty sure I've leaving something out/missing something, but I don't know what. This file is in /lib/outgoing_mail_filter.rb, which is loaded with config/initializers/required.rb Here's the old code that worked under Rails 2: class ActionMailer::Base def deliver_with_recipient_filter!(mail = @mail) unless 'production' == Rails.env mail.to = mail.to.to_a.delete_if do |to| !(to.ends_with?(