WhitelistMailProxy

A simple wrapper for the Mail gem / ActionMailer. Allow regexp based whitelisting

Example

Gemfile

gem "whitelist_mail_proxy"

config/application.rb

# this is a hack
ActionMailer::Base.add_delivery_method(:whitelist_proxy, WhitelistMailProxy)

config/staging.rb

config.action_mailer.delivery_method = :whitelist_proxy
# this will use the sendmail_settings defined elsewhere, or ActionMailer's default settings
config.action_mailer.whitelist_proxy_settings = {:delivery_method =>:sendmail, :regexp => /test@/}

or if you want a specific domain

config.action_mailer.whitelist_proxy_settings = {:delivery_method =>:sendmail, :domain => "gmail.com"

or if you want multiple domains

config.action_mailer.whitelist_proxy_settings = {:delivery_method =>:sendmail, :domain => ["gmail.com", "hotmail.com"]

Copyright © 2010 [Matthew Rudy Jacobs], released under the MIT license