Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mail_defender

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mail_defender

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Mail Defender

This gem intercepts and forwards email to a forwarding address in a non-production environment. This is to ensure that in staging or in development by mistake we do not deliver emails to the real people. However we need to test emails time to time.

Usage

# There is no need to include this gem for production or for test environment
gem 'mail_defender', group: [:development, :staging]
# config/initializers/mail_defender.rb
if Rails.env.development? || Rails.env.staging?
  ActiveSupport.on_load(:action_mailer) do
    register_interceptor(MailDefender.new({
      forward_emails_to: 'intercepted_emails@domain.com',
      deliver_emails_to: [/@wheel\.com$/, 'tester@allowed.test']
    }))
  end
end

Sending mail to xxx@deny.test with the above settings will actually send mail to "Orig to: xxx@deny.test" <intercepted_emails@domain.com>.

License

The gem is available as open source under the terms of the MIT License.

Thanks

Inspired by mail_interceptor.

FAQs

Package last updated on 17 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc