├── .ruby-version ├── Gemfile ├── .gitignore ├── gemfiles ├── mail2.8.gemfile ├── mail2.7.gemfile ├── rails7.1.gemfile ├── rails7.2.gemfile ├── rails8.0.gemfile ├── rails_main.gemfile ├── rails6.1.gemfile ├── rails7.0.gemfile ├── rails7.0.gemfile.lock ├── rails6.1.gemfile.lock ├── mail2.7.gemfile.lock ├── mail2.8.gemfile.lock ├── rails8.0.gemfile.lock ├── rails7.2.gemfile.lock └── rails7.1.gemfile.lock ├── lib ├── action_mailer_logged_smtp_delivery │ └── version.rb └── action_mailer │ └── logged_smtp_delivery.rb ├── script └── bundle ├── Rakefile ├── CHANGELOG.md ├── test ├── helper.rb └── logged_smtp_delivery_test.rb ├── .github └── workflows │ ├── rails_main_testing.yml │ ├── publish.yml │ └── actions.yml ├── CONTRIBUTING.md ├── LICENSE ├── action_mailer-logged_smtp_delivery.gemspec ├── README.md └── Gemfile.lock /.ruby-version: -------------------------------------------------------------------------------- 1 | 3.2.9 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gemspec 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle 2 | .idea 3 | .log 4 | coverage 5 | pkg 6 | vendor 7 | /gemfiles/rails_main.gemfile.lock 8 | -------------------------------------------------------------------------------- /gemfiles/mail2.8.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec path: '..' 4 | 5 | gem 'mail', '~> 2.8.0' 6 | -------------------------------------------------------------------------------- /gemfiles/mail2.7.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec path: '../' 4 | 5 | gem 'mail', '~> 2.7.0' 6 | -------------------------------------------------------------------------------- /lib/action_mailer_logged_smtp_delivery/version.rb: -------------------------------------------------------------------------------- 1 | module ActionMailerLoggedSMTPDelivery 2 | VERSION = "2.4.0" 3 | end 4 | -------------------------------------------------------------------------------- /gemfiles/rails7.1.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec path: '../' 4 | 5 | gem 'actionmailer', '~> 7.1.0' 6 | -------------------------------------------------------------------------------- /gemfiles/rails7.2.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec path: '../' 4 | 5 | gem 'actionmailer', '~> 7.2.0' 6 | -------------------------------------------------------------------------------- /gemfiles/rails8.0.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec path: '../' 4 | 5 | gem 'actionmailer', '~> 8.0.0' 6 | -------------------------------------------------------------------------------- /gemfiles/rails_main.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec path: '../' 4 | 5 | gem 'actionmailer', github: 'rails/rails' 6 | -------------------------------------------------------------------------------- /gemfiles/rails6.1.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec path: '../' 4 | 5 | gem 'actionmailer', '>= 6.1.7.1', '< 7.0' 6 | gem 'base64' 7 | gem 'bigdecimal' 8 | gem 'drb' 9 | gem 'mutex_m' 10 | -------------------------------------------------------------------------------- /gemfiles/rails7.0.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec path: '../' 4 | 5 | gem 'actionmailer', '>= 7.0.4.3', '< 7.1' 6 | gem 'base64' 7 | gem 'bigdecimal' 8 | gem 'drb' 9 | gem 'mutex_m' 10 | -------------------------------------------------------------------------------- /script/bundle: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export BUNDLE_CMD=$@ 4 | 5 | echo "Running this command all Gemfiles: $ bundle $BUNDLE_CMD" 6 | 7 | find . -maxdepth 2 -iname '*gemfile' | xargs -P10 -L1 -I % sh -c "BUNDLE_GEMFILE="%" bundle $BUNDLE_CMD" 8 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/setup" 2 | require "bundler/gem_tasks" 3 | require 'rake/testtask' 4 | require 'bump/tasks' 5 | 6 | Rake::TestTask.new(:test) do |test| 7 | test.pattern = 'test/**/*_test.rb' 8 | test.verbose = true 9 | end 10 | 11 | task :default => :test 12 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## Unreleased 9 | 10 | * Drop support for Ruby 3.1 11 | 12 | ## v2.4.0 13 | 14 | * Add support for mail 2.8+. 15 | * Drop support for Ruby 2.7 and 3.0. 16 | * Drop support for Rails 6.0. 17 | * Add tests with Rails 7.1, 7.2, 8.0, and main branch. 18 | -------------------------------------------------------------------------------- /test/helper.rb: -------------------------------------------------------------------------------- 1 | require 'bundler/setup' 2 | require 'action_mailer/logged_smtp_delivery' 3 | 4 | require 'minitest/autorun' 5 | require 'minitest/rg' 6 | require 'mocha/minitest' 7 | require 'logger' 8 | require 'mailcrate' 9 | 10 | I18n.enforce_available_locales = false 11 | 12 | Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) 13 | 14 | class MemoryLogger 15 | def log(message) 16 | messages << message 17 | end 18 | 19 | def messages 20 | @messages ||= [] 21 | end 22 | 23 | def clear 24 | messages.clear 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /.github/workflows/rails_main_testing.yml: -------------------------------------------------------------------------------- 1 | name: Test against Rails main 2 | 3 | on: 4 | schedule: 5 | - cron: "0 0 * * *" # Run every day at 00:00 UTC 6 | workflow_dispatch: 7 | push: 8 | 9 | jobs: 10 | main: 11 | name: Specs 12 | runs-on: [ubuntu-latest] 13 | env: 14 | BUNDLE_GEMFILE: gemfiles/rails_main.gemfile 15 | RAILS_ENV: test 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | rvm: 20 | - '3.4' 21 | steps: 22 | - uses: actions/checkout@v4 23 | - uses: ruby/setup-ruby@v1 24 | with: 25 | ruby-version: ${{ matrix.rvm }} 26 | bundler-cache: true 27 | - run: bundle exec rake test 28 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish to RubyGems.org 2 | 3 | on: 4 | push: 5 | branches: main 6 | paths: lib/action_mailer-logged_smtp_delivery/version.rb 7 | workflow_dispatch: 8 | 9 | jobs: 10 | publish: 11 | runs-on: ubuntu-latest 12 | environment: rubygems-publish 13 | if: github.repository_owner == 'zendesk' 14 | permissions: 15 | id-token: write 16 | contents: write 17 | steps: 18 | - uses: actions/checkout@v4 19 | - name: Set up Ruby 20 | uses: ruby/setup-ruby@v1 21 | with: 22 | bundler-cache: false 23 | 24 | - name: Install dependencies 25 | run: bundle install 26 | - uses: rubygems/release-gem@v1 27 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | For bug reports, open an [issue](https://github.com/zendesk/action_mailer-logged_smtp_delivery/issues) on GitHub. 2 | 3 | ## Getting Started 4 | 5 | 1. Install dependencies with `bundle install` 6 | 1. Run tests with `rake test` 7 | 8 | ### Releasing a new version 9 | A new version is published to RubyGems.org every time a change to `version.rb` is pushed to the `main` branch. 10 | In short, follow these steps: 11 | 1. Update `version.rb`, 12 | 2. run `script/bundle install` to update all `Gemfile.lock` files, 13 | 3. merge this change into `main`, and 14 | 4. look at [the action](https://github.com/zendesk/action_mailer-logged_smtp_delivery/actions/workflows/publish.yml) for output. 15 | 16 | To create a pre-release from a non-main branch: 17 | 1. change the version in `version.rb` to something like `1.2.0.pre.1` or `2.0.0.beta.2`, 18 | 2. push this change to your branch, 19 | 3. go to [Actions → “Publish to RubyGems.org” on GitHub](https://github.com/zendesk/action_mailer-logged_smtp_delivery/actions/workflows/publish.yml), 20 | 4. click the “Run workflow” button, 21 | 5. pick your branch from a dropdown. 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Eric Chapweske 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /.github/workflows/actions.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration 2 | on: 3 | push: 4 | branches: main 5 | pull_request: 6 | jobs: 7 | tests: 8 | name: Tests 9 | runs-on: ubuntu-latest 10 | env: 11 | BUNDLE_GEMFILE: ${{ matrix.gemfile }} 12 | RAILS_ENV: test 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | rvm: 17 | - '3.2' 18 | - '3.3' 19 | - '3.4' 20 | gemfile: 21 | - gemfiles/mail2.7.gemfile 22 | - gemfiles/mail2.8.gemfile 23 | - gemfiles/rails6.1.gemfile 24 | - gemfiles/rails7.0.gemfile 25 | - gemfiles/rails7.1.gemfile 26 | - gemfiles/rails7.2.gemfile 27 | - gemfiles/rails8.0.gemfile 28 | steps: 29 | - uses: actions/checkout@v4 30 | - uses: ruby/setup-ruby@v1 31 | with: 32 | ruby-version: ${{ matrix.rvm }} 33 | bundler-cache: true 34 | - run: bundle exec rake test 35 | 36 | tests_successful: 37 | name: Tests passing? 38 | needs: tests 39 | if: always() 40 | runs-on: ubuntu-latest 41 | steps: 42 | - run: | 43 | if ${{ needs.tests.result == 'success' }} 44 | then 45 | echo "All tests pass" 46 | else 47 | echo "Some tests failed" 48 | false 49 | fi 50 | -------------------------------------------------------------------------------- /lib/action_mailer/logged_smtp_delivery.rb: -------------------------------------------------------------------------------- 1 | require 'action_mailer' 2 | require 'mail/network/delivery_methods/smtp' 3 | 4 | class ActionMailer::LoggedSMTPDelivery < Mail::SMTP 5 | attr_accessor :response 6 | 7 | def initialize(settings) 8 | super 9 | self.settings[:tls] = (settings[:tls] != false) 10 | self.settings[:return_response] = true 11 | self.logger = settings[:logger] 12 | self.response = nil 13 | end 14 | 15 | def deliver!(mail) 16 | if file_logger = settings[:mail_file_logger] 17 | path = file_logger.log(mail.encoded) 18 | log mail, "stored at #{path}" 19 | end 20 | 21 | log_headers(mail) 22 | log mail, "sender: #{mail.sender}" 23 | log mail, "destinations: #{mail.destinations.inspect}" 24 | 25 | begin 26 | self.response = super 27 | log mail, "done #{response.inspect}" 28 | rescue => e 29 | logger.error("#{mail.message_id} exception #{e.inspect}") 30 | raise 31 | end 32 | end 33 | 34 | private 35 | 36 | attr_accessor :logger 37 | 38 | def log_headers(mail) 39 | log mail, "#{log_header}: [#{mail[log_header]}]" if log_header 40 | end 41 | 42 | def log_header 43 | settings[:log_header] 44 | end 45 | 46 | def log(mail, message) 47 | logger.info("#{mail.message_id} #{message}") 48 | end 49 | end 50 | 51 | ActionMailer::Base.add_delivery_method :logged_smtp, ActionMailer::LoggedSMTPDelivery 52 | -------------------------------------------------------------------------------- /action_mailer-logged_smtp_delivery.gemspec: -------------------------------------------------------------------------------- 1 | require_relative 'lib/action_mailer_logged_smtp_delivery/version' 2 | 3 | Gem::Specification.new do |gem| 4 | gem.authors = ['Eric Chapweske'] 5 | gem.description = "ActionMailer SMTP delivery strategy with advanced logging and Bcc support" 6 | gem.summary = "An ActionMailer delivery strategy" 7 | gem.homepage = 'https://github.com/zendesk/action_mailer-logged_smtp_delivery' 8 | 9 | gem.files = Dir.glob('lib/**/*') + ['README.md'] 10 | 11 | gem.name = 'action_mailer-logged_smtp_delivery' 12 | gem.version = ActionMailerLoggedSMTPDelivery::VERSION 13 | gem.license = "Apache V2" 14 | 15 | gem.required_ruby_version = ">= 3.2" 16 | 17 | gem.add_runtime_dependency 'actionmailer', '>= 6.1' 18 | gem.add_runtime_dependency 'globalid', '>= 1.0.1' 19 | gem.add_runtime_dependency 'loofah', '>= 2.19.1' 20 | gem.add_runtime_dependency 'mail' 21 | gem.add_runtime_dependency 'net-smtp' 22 | gem.add_runtime_dependency 'nokogiri', '>= 1.13.9' 23 | gem.add_runtime_dependency 'rack', '>= 2.2.6.4' 24 | gem.add_runtime_dependency 'rails-html-sanitizer', '>= 1.4.4' 25 | 26 | gem.add_development_dependency 'bump' 27 | gem.add_development_dependency 'byebug' 28 | gem.add_development_dependency 'mailcrate' 29 | gem.add_development_dependency 'minitest-rg' 30 | gem.add_development_dependency 'minitest' 31 | gem.add_development_dependency 'mocha' 32 | gem.add_development_dependency 'rake' 33 | end 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Logged SMTP Delivery 2 | 3 | ```Ruby 4 | require 'action_mailer/logged_smtp_delivery' 5 | config.action_mailer.logged_smtp_settings = { 6 | ... normal smtp settings ..., 7 | logger: Logger.new, # progress info 8 | mail_file_logger: FileLogger.new # write encoded mails for storage, must return path they were stored in 9 | } 10 | 11 | 12 | ``` 13 | 14 | 15 | ### Detailed log stream with message id prefix. Example: 16 | 17 | ``` 18 | <4e2b38d772949_b81ac212@localhost> stored at example/log/mails/outbound/2011-07-23/7_13462_2.eml 19 | <4e2b38d772949_b81ac212@localhost> X-Delivery-Context: [users/1/welcome] 20 | <4e2b38d772949_b81ac212@localhost> sender: support@support.localhost 21 | <4e2b38d772949_b81ac212@localhost> destinations: support@system.example.com 22 | <4e2b38d772949_b81ac212@localhost> done # 23 | ``` 24 | 25 | ### Logs an identification header to quickly locate logs for a specific email/entity 26 | 27 | ```ruby 28 | config.action_mailer.logged_smtp_settings[:log_header] = 'X-Delivery-Context' 29 | 30 | class UsersMailer < ActionMailer::Base 31 | 32 | def welcome(user) 33 | headers['X-Delivery-Context'] = "users/#{user.id}/welcome" 34 | 35 | # ... 36 | end 37 | end 38 | 39 | 40 | UsersMailer.welcome(user).deliver 41 | # ActionMailer::Base.logger -> 42 | # <4e2b38d772949_b81ac212@localhost> X-Delivery-Context: [users/1/welcome] 43 | ``` 44 | 45 | ### Doesn't render BCC recipients 46 | 47 | License: Apache V2 48 | 49 | -------------------------------------------------------------------------------- /gemfiles/rails7.0.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: .. 3 | specs: 4 | action_mailer-logged_smtp_delivery (2.4.0) 5 | actionmailer (>= 6.1) 6 | globalid (>= 1.0.1) 7 | loofah (>= 2.19.1) 8 | mail 9 | net-smtp 10 | nokogiri (>= 1.13.9) 11 | rack (>= 2.2.6.4) 12 | rails-html-sanitizer (>= 1.4.4) 13 | 14 | GEM 15 | remote: https://rubygems.org/ 16 | specs: 17 | actionmailer (7.0.8.6) 18 | actionpack (= 7.0.8.6) 19 | actionview (= 7.0.8.6) 20 | activejob (= 7.0.8.6) 21 | activesupport (= 7.0.8.6) 22 | mail (~> 2.5, >= 2.5.4) 23 | net-imap 24 | net-pop 25 | net-smtp 26 | rails-dom-testing (~> 2.0) 27 | actionpack (7.0.8.6) 28 | actionview (= 7.0.8.6) 29 | activesupport (= 7.0.8.6) 30 | rack (~> 2.0, >= 2.2.4) 31 | rack-test (>= 0.6.3) 32 | rails-dom-testing (~> 2.0) 33 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 34 | actionview (7.0.8.6) 35 | activesupport (= 7.0.8.6) 36 | builder (~> 3.1) 37 | erubi (~> 1.4) 38 | rails-dom-testing (~> 2.0) 39 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 40 | activejob (7.0.8.6) 41 | activesupport (= 7.0.8.6) 42 | globalid (>= 0.3.6) 43 | activesupport (7.0.8.6) 44 | concurrent-ruby (~> 1.0, >= 1.0.2) 45 | i18n (>= 1.6, < 2) 46 | minitest (>= 5.1) 47 | tzinfo (~> 2.0) 48 | base64 (0.2.0) 49 | bigdecimal (3.1.9) 50 | builder (3.3.0) 51 | bump (0.10.0) 52 | byebug (11.1.3) 53 | concurrent-ruby (1.3.4) 54 | crass (1.0.6) 55 | date (3.4.0) 56 | drb (2.2.1) 57 | erubi (1.13.0) 58 | globalid (1.2.1) 59 | activesupport (>= 6.1) 60 | i18n (1.14.6) 61 | concurrent-ruby (~> 1.0) 62 | logger (1.7.0) 63 | loofah (2.23.1) 64 | crass (~> 1.0.2) 65 | nokogiri (>= 1.12.0) 66 | mail (2.9.0) 67 | logger 68 | mini_mime (>= 0.1.1) 69 | net-imap 70 | net-pop 71 | net-smtp 72 | mailcrate (0.0.6) 73 | mini_mime (1.1.5) 74 | mini_portile2 (2.8.8) 75 | minitest (5.25.4) 76 | minitest-rg (5.3.0) 77 | minitest (~> 5.0) 78 | mocha (2.5.0) 79 | ruby2_keywords (>= 0.0.5) 80 | mutex_m (0.3.0) 81 | net-imap (0.5.1) 82 | date 83 | net-protocol 84 | net-pop (0.1.2) 85 | net-protocol 86 | net-protocol (0.2.2) 87 | timeout 88 | net-smtp (0.5.0) 89 | net-protocol 90 | nokogiri (1.18.9) 91 | mini_portile2 (~> 2.8.2) 92 | racc (~> 1.4) 93 | racc (1.8.1) 94 | rack (2.2.20) 95 | rack-test (2.1.0) 96 | rack (>= 1.3) 97 | rails-dom-testing (2.2.0) 98 | activesupport (>= 5.0.0) 99 | minitest 100 | nokogiri (>= 1.6) 101 | rails-html-sanitizer (1.6.0) 102 | loofah (~> 2.21) 103 | nokogiri (~> 1.14) 104 | rake (13.2.1) 105 | ruby2_keywords (0.0.5) 106 | timeout (0.4.2) 107 | tzinfo (2.0.6) 108 | concurrent-ruby (~> 1.0) 109 | 110 | PLATFORMS 111 | ruby 112 | 113 | DEPENDENCIES 114 | action_mailer-logged_smtp_delivery! 115 | actionmailer (>= 7.0.4.3, < 7.1) 116 | base64 117 | bigdecimal 118 | bump 119 | byebug 120 | drb 121 | mailcrate 122 | minitest 123 | minitest-rg 124 | mocha 125 | mutex_m 126 | rake 127 | 128 | BUNDLED WITH 129 | 2.6.2 130 | -------------------------------------------------------------------------------- /gemfiles/rails6.1.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: .. 3 | specs: 4 | action_mailer-logged_smtp_delivery (2.4.0) 5 | actionmailer (>= 6.1) 6 | globalid (>= 1.0.1) 7 | loofah (>= 2.19.1) 8 | mail 9 | net-smtp 10 | nokogiri (>= 1.13.9) 11 | rack (>= 2.2.6.4) 12 | rails-html-sanitizer (>= 1.4.4) 13 | 14 | GEM 15 | remote: https://rubygems.org/ 16 | specs: 17 | actionmailer (6.1.7.10) 18 | actionpack (= 6.1.7.10) 19 | actionview (= 6.1.7.10) 20 | activejob (= 6.1.7.10) 21 | activesupport (= 6.1.7.10) 22 | mail (~> 2.5, >= 2.5.4) 23 | rails-dom-testing (~> 2.0) 24 | actionpack (6.1.7.10) 25 | actionview (= 6.1.7.10) 26 | activesupport (= 6.1.7.10) 27 | rack (~> 2.0, >= 2.0.9) 28 | rack-test (>= 0.6.3) 29 | rails-dom-testing (~> 2.0) 30 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 31 | actionview (6.1.7.10) 32 | activesupport (= 6.1.7.10) 33 | builder (~> 3.1) 34 | erubi (~> 1.4) 35 | rails-dom-testing (~> 2.0) 36 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 37 | activejob (6.1.7.10) 38 | activesupport (= 6.1.7.10) 39 | globalid (>= 0.3.6) 40 | activesupport (6.1.7.10) 41 | concurrent-ruby (~> 1.0, >= 1.0.2) 42 | i18n (>= 1.6, < 2) 43 | minitest (>= 5.1) 44 | tzinfo (~> 2.0) 45 | zeitwerk (~> 2.3) 46 | base64 (0.2.0) 47 | bigdecimal (3.1.9) 48 | builder (3.3.0) 49 | bump (0.10.0) 50 | byebug (11.1.3) 51 | concurrent-ruby (1.3.4) 52 | crass (1.0.6) 53 | date (3.4.0) 54 | drb (2.2.1) 55 | erubi (1.13.0) 56 | globalid (1.2.1) 57 | activesupport (>= 6.1) 58 | i18n (1.14.6) 59 | concurrent-ruby (~> 1.0) 60 | logger (1.7.0) 61 | loofah (2.23.1) 62 | crass (~> 1.0.2) 63 | nokogiri (>= 1.12.0) 64 | mail (2.9.0) 65 | logger 66 | mini_mime (>= 0.1.1) 67 | net-imap 68 | net-pop 69 | net-smtp 70 | mailcrate (0.0.6) 71 | mini_mime (1.1.5) 72 | mini_portile2 (2.8.8) 73 | minitest (5.25.4) 74 | minitest-rg (5.3.0) 75 | minitest (~> 5.0) 76 | mocha (2.5.0) 77 | ruby2_keywords (>= 0.0.5) 78 | mutex_m (0.3.0) 79 | net-imap (0.5.1) 80 | date 81 | net-protocol 82 | net-pop (0.1.2) 83 | net-protocol 84 | net-protocol (0.2.2) 85 | timeout 86 | net-smtp (0.5.0) 87 | net-protocol 88 | nokogiri (1.18.9) 89 | mini_portile2 (~> 2.8.2) 90 | racc (~> 1.4) 91 | racc (1.8.1) 92 | rack (2.2.20) 93 | rack-test (2.1.0) 94 | rack (>= 1.3) 95 | rails-dom-testing (2.2.0) 96 | activesupport (>= 5.0.0) 97 | minitest 98 | nokogiri (>= 1.6) 99 | rails-html-sanitizer (1.6.0) 100 | loofah (~> 2.21) 101 | nokogiri (~> 1.14) 102 | rake (13.2.1) 103 | ruby2_keywords (0.0.5) 104 | timeout (0.4.2) 105 | tzinfo (2.0.6) 106 | concurrent-ruby (~> 1.0) 107 | zeitwerk (2.6.18) 108 | 109 | PLATFORMS 110 | ruby 111 | 112 | DEPENDENCIES 113 | action_mailer-logged_smtp_delivery! 114 | actionmailer (>= 6.1.7.1, < 7.0) 115 | base64 116 | bigdecimal 117 | bump 118 | byebug 119 | drb 120 | mailcrate 121 | minitest 122 | minitest-rg 123 | mocha 124 | mutex_m 125 | rake 126 | 127 | BUNDLED WITH 128 | 2.6.2 129 | -------------------------------------------------------------------------------- /gemfiles/mail2.7.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: .. 3 | specs: 4 | action_mailer-logged_smtp_delivery (2.4.0) 5 | actionmailer (>= 6.1) 6 | globalid (>= 1.0.1) 7 | loofah (>= 2.19.1) 8 | mail 9 | net-smtp 10 | nokogiri (>= 1.13.9) 11 | rack (>= 2.2.6.4) 12 | rails-html-sanitizer (>= 1.4.4) 13 | 14 | GEM 15 | remote: https://rubygems.org/ 16 | specs: 17 | actionmailer (7.1.5) 18 | actionpack (= 7.1.5) 19 | actionview (= 7.1.5) 20 | activejob (= 7.1.5) 21 | activesupport (= 7.1.5) 22 | mail (~> 2.5, >= 2.5.4) 23 | net-imap 24 | net-pop 25 | net-smtp 26 | rails-dom-testing (~> 2.2) 27 | actionpack (7.1.5) 28 | actionview (= 7.1.5) 29 | activesupport (= 7.1.5) 30 | nokogiri (>= 1.8.5) 31 | racc 32 | rack (>= 2.2.4) 33 | rack-session (>= 1.0.1) 34 | rack-test (>= 0.6.3) 35 | rails-dom-testing (~> 2.2) 36 | rails-html-sanitizer (~> 1.6) 37 | actionview (7.1.5) 38 | activesupport (= 7.1.5) 39 | builder (~> 3.1) 40 | erubi (~> 1.11) 41 | rails-dom-testing (~> 2.2) 42 | rails-html-sanitizer (~> 1.6) 43 | activejob (7.1.5) 44 | activesupport (= 7.1.5) 45 | globalid (>= 0.3.6) 46 | activesupport (7.1.5) 47 | base64 48 | benchmark (>= 0.3) 49 | bigdecimal 50 | concurrent-ruby (~> 1.0, >= 1.0.2) 51 | connection_pool (>= 2.2.5) 52 | drb 53 | i18n (>= 1.6, < 2) 54 | logger (>= 1.4.2) 55 | minitest (>= 5.1) 56 | mutex_m 57 | securerandom (>= 0.3) 58 | tzinfo (~> 2.0) 59 | base64 (0.2.0) 60 | benchmark (0.4.0) 61 | bigdecimal (3.1.8) 62 | builder (3.3.0) 63 | bump (0.10.0) 64 | byebug (11.1.3) 65 | concurrent-ruby (1.3.4) 66 | connection_pool (2.4.1) 67 | crass (1.0.6) 68 | date (3.4.0) 69 | drb (2.2.1) 70 | erubi (1.13.0) 71 | globalid (1.2.1) 72 | activesupport (>= 6.1) 73 | i18n (1.14.6) 74 | concurrent-ruby (~> 1.0) 75 | logger (1.6.1) 76 | loofah (2.23.1) 77 | crass (~> 1.0.2) 78 | nokogiri (>= 1.12.0) 79 | mail (2.7.1) 80 | mini_mime (>= 0.1.1) 81 | mailcrate (0.0.6) 82 | mini_mime (1.1.5) 83 | mini_portile2 (2.8.8) 84 | minitest (5.25.4) 85 | minitest-rg (5.3.0) 86 | minitest (~> 5.0) 87 | mocha (2.5.0) 88 | ruby2_keywords (>= 0.0.5) 89 | mutex_m (0.2.0) 90 | net-imap (0.5.1) 91 | date 92 | net-protocol 93 | net-pop (0.1.2) 94 | net-protocol 95 | net-protocol (0.2.2) 96 | timeout 97 | net-smtp (0.5.0) 98 | net-protocol 99 | nokogiri (1.18.9) 100 | mini_portile2 (~> 2.8.2) 101 | racc (~> 1.4) 102 | racc (1.8.1) 103 | rack (3.2.3) 104 | rack-session (2.0.0) 105 | rack (>= 3.0.0) 106 | rack-test (2.1.0) 107 | rack (>= 1.3) 108 | rails-dom-testing (2.2.0) 109 | activesupport (>= 5.0.0) 110 | minitest 111 | nokogiri (>= 1.6) 112 | rails-html-sanitizer (1.6.0) 113 | loofah (~> 2.21) 114 | nokogiri (~> 1.14) 115 | rake (13.2.1) 116 | ruby2_keywords (0.0.5) 117 | securerandom (0.3.2) 118 | timeout (0.4.2) 119 | tzinfo (2.0.6) 120 | concurrent-ruby (~> 1.0) 121 | 122 | PLATFORMS 123 | ruby 124 | 125 | DEPENDENCIES 126 | action_mailer-logged_smtp_delivery! 127 | bump 128 | byebug 129 | mail (~> 2.7.0) 130 | mailcrate 131 | minitest 132 | minitest-rg 133 | mocha 134 | rake 135 | 136 | BUNDLED WITH 137 | 2.6.2 138 | -------------------------------------------------------------------------------- /gemfiles/mail2.8.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: .. 3 | specs: 4 | action_mailer-logged_smtp_delivery (2.4.0) 5 | actionmailer (>= 6.1) 6 | globalid (>= 1.0.1) 7 | loofah (>= 2.19.1) 8 | mail 9 | net-smtp 10 | nokogiri (>= 1.13.9) 11 | rack (>= 2.2.6.4) 12 | rails-html-sanitizer (>= 1.4.4) 13 | 14 | GEM 15 | remote: https://rubygems.org/ 16 | specs: 17 | actionmailer (7.1.5) 18 | actionpack (= 7.1.5) 19 | actionview (= 7.1.5) 20 | activejob (= 7.1.5) 21 | activesupport (= 7.1.5) 22 | mail (~> 2.5, >= 2.5.4) 23 | net-imap 24 | net-pop 25 | net-smtp 26 | rails-dom-testing (~> 2.2) 27 | actionpack (7.1.5) 28 | actionview (= 7.1.5) 29 | activesupport (= 7.1.5) 30 | nokogiri (>= 1.8.5) 31 | racc 32 | rack (>= 2.2.4) 33 | rack-session (>= 1.0.1) 34 | rack-test (>= 0.6.3) 35 | rails-dom-testing (~> 2.2) 36 | rails-html-sanitizer (~> 1.6) 37 | actionview (7.1.5) 38 | activesupport (= 7.1.5) 39 | builder (~> 3.1) 40 | erubi (~> 1.11) 41 | rails-dom-testing (~> 2.2) 42 | rails-html-sanitizer (~> 1.6) 43 | activejob (7.1.5) 44 | activesupport (= 7.1.5) 45 | globalid (>= 0.3.6) 46 | activesupport (7.1.5) 47 | base64 48 | benchmark (>= 0.3) 49 | bigdecimal 50 | concurrent-ruby (~> 1.0, >= 1.0.2) 51 | connection_pool (>= 2.2.5) 52 | drb 53 | i18n (>= 1.6, < 2) 54 | logger (>= 1.4.2) 55 | minitest (>= 5.1) 56 | mutex_m 57 | securerandom (>= 0.3) 58 | tzinfo (~> 2.0) 59 | base64 (0.2.0) 60 | benchmark (0.4.0) 61 | bigdecimal (3.1.8) 62 | builder (3.3.0) 63 | bump (0.10.0) 64 | byebug (11.1.3) 65 | concurrent-ruby (1.3.4) 66 | connection_pool (2.4.1) 67 | crass (1.0.6) 68 | date (3.4.0) 69 | drb (2.2.1) 70 | erubi (1.13.0) 71 | globalid (1.2.1) 72 | activesupport (>= 6.1) 73 | i18n (1.14.6) 74 | concurrent-ruby (~> 1.0) 75 | logger (1.6.1) 76 | loofah (2.23.1) 77 | crass (~> 1.0.2) 78 | nokogiri (>= 1.12.0) 79 | mail (2.8.1) 80 | mini_mime (>= 0.1.1) 81 | net-imap 82 | net-pop 83 | net-smtp 84 | mailcrate (0.0.6) 85 | mini_mime (1.1.5) 86 | mini_portile2 (2.8.8) 87 | minitest (5.25.1) 88 | minitest-rg (5.3.0) 89 | minitest (~> 5.0) 90 | mocha (2.5.0) 91 | ruby2_keywords (>= 0.0.5) 92 | mutex_m (0.2.0) 93 | net-imap (0.5.1) 94 | date 95 | net-protocol 96 | net-pop (0.1.2) 97 | net-protocol 98 | net-protocol (0.2.2) 99 | timeout 100 | net-smtp (0.5.0) 101 | net-protocol 102 | nokogiri (1.16.7) 103 | mini_portile2 (~> 2.8.2) 104 | racc (~> 1.4) 105 | racc (1.8.1) 106 | rack (3.2.3) 107 | rack-session (2.0.0) 108 | rack (>= 3.0.0) 109 | rack-test (2.1.0) 110 | rack (>= 1.3) 111 | rails-dom-testing (2.2.0) 112 | activesupport (>= 5.0.0) 113 | minitest 114 | nokogiri (>= 1.6) 115 | rails-html-sanitizer (1.6.0) 116 | loofah (~> 2.21) 117 | nokogiri (~> 1.14) 118 | rake (13.2.1) 119 | ruby2_keywords (0.0.5) 120 | securerandom (0.3.2) 121 | timeout (0.4.2) 122 | tzinfo (2.0.6) 123 | concurrent-ruby (~> 1.0) 124 | 125 | PLATFORMS 126 | ruby 127 | 128 | DEPENDENCIES 129 | action_mailer-logged_smtp_delivery! 130 | bump 131 | byebug 132 | mail (~> 2.8.0) 133 | mailcrate 134 | minitest 135 | minitest-rg 136 | mocha 137 | rake 138 | 139 | BUNDLED WITH 140 | 2.6.2 141 | -------------------------------------------------------------------------------- /gemfiles/rails8.0.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: .. 3 | specs: 4 | action_mailer-logged_smtp_delivery (2.4.0) 5 | actionmailer (>= 6.1) 6 | globalid (>= 1.0.1) 7 | loofah (>= 2.19.1) 8 | mail 9 | net-smtp 10 | nokogiri (>= 1.13.9) 11 | rack (>= 2.2.6.4) 12 | rails-html-sanitizer (>= 1.4.4) 13 | 14 | GEM 15 | remote: https://rubygems.org/ 16 | specs: 17 | actionmailer (8.0.0) 18 | actionpack (= 8.0.0) 19 | actionview (= 8.0.0) 20 | activejob (= 8.0.0) 21 | activesupport (= 8.0.0) 22 | mail (>= 2.8.0) 23 | rails-dom-testing (~> 2.2) 24 | actionpack (8.0.0) 25 | actionview (= 8.0.0) 26 | activesupport (= 8.0.0) 27 | nokogiri (>= 1.8.5) 28 | rack (>= 2.2.4) 29 | rack-session (>= 1.0.1) 30 | rack-test (>= 0.6.3) 31 | rails-dom-testing (~> 2.2) 32 | rails-html-sanitizer (~> 1.6) 33 | useragent (~> 0.16) 34 | actionview (8.0.0) 35 | activesupport (= 8.0.0) 36 | builder (~> 3.1) 37 | erubi (~> 1.11) 38 | rails-dom-testing (~> 2.2) 39 | rails-html-sanitizer (~> 1.6) 40 | activejob (8.0.0) 41 | activesupport (= 8.0.0) 42 | globalid (>= 0.3.6) 43 | activesupport (8.0.0) 44 | base64 45 | benchmark (>= 0.3) 46 | bigdecimal 47 | concurrent-ruby (~> 1.0, >= 1.3.1) 48 | connection_pool (>= 2.2.5) 49 | drb 50 | i18n (>= 1.6, < 2) 51 | logger (>= 1.4.2) 52 | minitest (>= 5.1) 53 | securerandom (>= 0.3) 54 | tzinfo (~> 2.0, >= 2.0.5) 55 | uri (>= 0.13.1) 56 | base64 (0.2.0) 57 | benchmark (0.4.0) 58 | bigdecimal (3.1.8) 59 | builder (3.3.0) 60 | bump (0.10.0) 61 | byebug (11.1.3) 62 | concurrent-ruby (1.3.4) 63 | connection_pool (2.4.1) 64 | crass (1.0.6) 65 | date (3.4.0) 66 | drb (2.2.1) 67 | erubi (1.13.0) 68 | globalid (1.2.1) 69 | activesupport (>= 6.1) 70 | i18n (1.14.6) 71 | concurrent-ruby (~> 1.0) 72 | logger (1.6.1) 73 | loofah (2.23.1) 74 | crass (~> 1.0.2) 75 | nokogiri (>= 1.12.0) 76 | mail (2.9.0) 77 | logger 78 | mini_mime (>= 0.1.1) 79 | net-imap 80 | net-pop 81 | net-smtp 82 | mailcrate (0.0.6) 83 | mini_mime (1.1.5) 84 | mini_portile2 (2.8.8) 85 | minitest (5.25.4) 86 | minitest-rg (5.3.0) 87 | minitest (~> 5.0) 88 | mocha (2.5.0) 89 | ruby2_keywords (>= 0.0.5) 90 | net-imap (0.5.1) 91 | date 92 | net-protocol 93 | net-pop (0.1.2) 94 | net-protocol 95 | net-protocol (0.2.2) 96 | timeout 97 | net-smtp (0.5.0) 98 | net-protocol 99 | nokogiri (1.18.1) 100 | mini_portile2 (~> 2.8.2) 101 | racc (~> 1.4) 102 | racc (1.8.1) 103 | rack (3.1.8) 104 | rack-session (2.0.0) 105 | rack (>= 3.0.0) 106 | rack-test (2.1.0) 107 | rack (>= 1.3) 108 | rails-dom-testing (2.2.0) 109 | activesupport (>= 5.0.0) 110 | minitest 111 | nokogiri (>= 1.6) 112 | rails-html-sanitizer (1.6.0) 113 | loofah (~> 2.21) 114 | nokogiri (~> 1.14) 115 | rake (13.2.1) 116 | ruby2_keywords (0.0.5) 117 | securerandom (0.3.2) 118 | timeout (0.4.2) 119 | tzinfo (2.0.6) 120 | concurrent-ruby (~> 1.0) 121 | uri (1.0.2) 122 | useragent (0.16.10) 123 | 124 | PLATFORMS 125 | ruby 126 | 127 | DEPENDENCIES 128 | action_mailer-logged_smtp_delivery! 129 | actionmailer (~> 8.0.0) 130 | bump 131 | byebug 132 | mailcrate 133 | minitest 134 | minitest-rg 135 | mocha 136 | rake 137 | 138 | BUNDLED WITH 139 | 2.6.2 140 | -------------------------------------------------------------------------------- /gemfiles/rails7.2.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: .. 3 | specs: 4 | action_mailer-logged_smtp_delivery (2.4.0) 5 | actionmailer (>= 6.1) 6 | globalid (>= 1.0.1) 7 | loofah (>= 2.19.1) 8 | mail 9 | net-smtp 10 | nokogiri (>= 1.13.9) 11 | rack (>= 2.2.6.4) 12 | rails-html-sanitizer (>= 1.4.4) 13 | 14 | GEM 15 | remote: https://rubygems.org/ 16 | specs: 17 | actionmailer (7.2.2) 18 | actionpack (= 7.2.2) 19 | actionview (= 7.2.2) 20 | activejob (= 7.2.2) 21 | activesupport (= 7.2.2) 22 | mail (>= 2.8.0) 23 | rails-dom-testing (~> 2.2) 24 | actionpack (7.2.2) 25 | actionview (= 7.2.2) 26 | activesupport (= 7.2.2) 27 | nokogiri (>= 1.8.5) 28 | racc 29 | rack (>= 2.2.4, < 3.2) 30 | rack-session (>= 1.0.1) 31 | rack-test (>= 0.6.3) 32 | rails-dom-testing (~> 2.2) 33 | rails-html-sanitizer (~> 1.6) 34 | useragent (~> 0.16) 35 | actionview (7.2.2) 36 | activesupport (= 7.2.2) 37 | builder (~> 3.1) 38 | erubi (~> 1.11) 39 | rails-dom-testing (~> 2.2) 40 | rails-html-sanitizer (~> 1.6) 41 | activejob (7.2.2) 42 | activesupport (= 7.2.2) 43 | globalid (>= 0.3.6) 44 | activesupport (7.2.2) 45 | base64 46 | benchmark (>= 0.3) 47 | bigdecimal 48 | concurrent-ruby (~> 1.0, >= 1.3.1) 49 | connection_pool (>= 2.2.5) 50 | drb 51 | i18n (>= 1.6, < 2) 52 | logger (>= 1.4.2) 53 | minitest (>= 5.1) 54 | securerandom (>= 0.3) 55 | tzinfo (~> 2.0, >= 2.0.5) 56 | base64 (0.2.0) 57 | benchmark (0.4.0) 58 | bigdecimal (3.1.8) 59 | builder (3.3.0) 60 | bump (0.10.0) 61 | byebug (11.1.3) 62 | concurrent-ruby (1.3.4) 63 | connection_pool (2.4.1) 64 | crass (1.0.6) 65 | date (3.4.0) 66 | drb (2.2.1) 67 | erubi (1.13.0) 68 | globalid (1.2.1) 69 | activesupport (>= 6.1) 70 | i18n (1.14.6) 71 | concurrent-ruby (~> 1.0) 72 | logger (1.6.1) 73 | loofah (2.23.1) 74 | crass (~> 1.0.2) 75 | nokogiri (>= 1.12.0) 76 | mail (2.9.0) 77 | logger 78 | mini_mime (>= 0.1.1) 79 | net-imap 80 | net-pop 81 | net-smtp 82 | mailcrate (0.0.6) 83 | mini_mime (1.1.5) 84 | mini_portile2 (2.8.8) 85 | minitest (5.25.4) 86 | minitest-rg (5.3.0) 87 | minitest (~> 5.0) 88 | mocha (2.5.0) 89 | ruby2_keywords (>= 0.0.5) 90 | net-imap (0.5.1) 91 | date 92 | net-protocol 93 | net-pop (0.1.2) 94 | net-protocol 95 | net-protocol (0.2.2) 96 | timeout 97 | net-smtp (0.5.0) 98 | net-protocol 99 | nokogiri (1.18.9) 100 | mini_portile2 (~> 2.8.2) 101 | racc (~> 1.4) 102 | racc (1.8.1) 103 | rack (3.1.18) 104 | rack-session (2.1.1) 105 | base64 (>= 0.1.0) 106 | rack (>= 3.0.0) 107 | rack-test (2.1.0) 108 | rack (>= 1.3) 109 | rails-dom-testing (2.2.0) 110 | activesupport (>= 5.0.0) 111 | minitest 112 | nokogiri (>= 1.6) 113 | rails-html-sanitizer (1.6.0) 114 | loofah (~> 2.21) 115 | nokogiri (~> 1.14) 116 | rake (13.2.1) 117 | ruby2_keywords (0.0.5) 118 | securerandom (0.3.2) 119 | timeout (0.4.2) 120 | tzinfo (2.0.6) 121 | concurrent-ruby (~> 1.0) 122 | useragent (0.16.10) 123 | 124 | PLATFORMS 125 | ruby 126 | 127 | DEPENDENCIES 128 | action_mailer-logged_smtp_delivery! 129 | actionmailer (~> 7.2.0) 130 | bump 131 | byebug 132 | mailcrate 133 | minitest 134 | minitest-rg 135 | mocha 136 | rake 137 | 138 | BUNDLED WITH 139 | 2.6.2 140 | -------------------------------------------------------------------------------- /gemfiles/rails7.1.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: .. 3 | specs: 4 | action_mailer-logged_smtp_delivery (2.4.0) 5 | actionmailer (>= 6.1) 6 | globalid (>= 1.0.1) 7 | loofah (>= 2.19.1) 8 | mail 9 | net-smtp 10 | nokogiri (>= 1.13.9) 11 | rack (>= 2.2.6.4) 12 | rails-html-sanitizer (>= 1.4.4) 13 | 14 | GEM 15 | remote: https://rubygems.org/ 16 | specs: 17 | actionmailer (7.1.5) 18 | actionpack (= 7.1.5) 19 | actionview (= 7.1.5) 20 | activejob (= 7.1.5) 21 | activesupport (= 7.1.5) 22 | mail (~> 2.5, >= 2.5.4) 23 | net-imap 24 | net-pop 25 | net-smtp 26 | rails-dom-testing (~> 2.2) 27 | actionpack (7.1.5) 28 | actionview (= 7.1.5) 29 | activesupport (= 7.1.5) 30 | nokogiri (>= 1.8.5) 31 | racc 32 | rack (>= 2.2.4) 33 | rack-session (>= 1.0.1) 34 | rack-test (>= 0.6.3) 35 | rails-dom-testing (~> 2.2) 36 | rails-html-sanitizer (~> 1.6) 37 | actionview (7.1.5) 38 | activesupport (= 7.1.5) 39 | builder (~> 3.1) 40 | erubi (~> 1.11) 41 | rails-dom-testing (~> 2.2) 42 | rails-html-sanitizer (~> 1.6) 43 | activejob (7.1.5) 44 | activesupport (= 7.1.5) 45 | globalid (>= 0.3.6) 46 | activesupport (7.1.5) 47 | base64 48 | benchmark (>= 0.3) 49 | bigdecimal 50 | concurrent-ruby (~> 1.0, >= 1.0.2) 51 | connection_pool (>= 2.2.5) 52 | drb 53 | i18n (>= 1.6, < 2) 54 | logger (>= 1.4.2) 55 | minitest (>= 5.1) 56 | mutex_m 57 | securerandom (>= 0.3) 58 | tzinfo (~> 2.0) 59 | base64 (0.2.0) 60 | benchmark (0.4.0) 61 | bigdecimal (3.1.8) 62 | builder (3.3.0) 63 | bump (0.10.0) 64 | byebug (11.1.3) 65 | concurrent-ruby (1.3.4) 66 | connection_pool (2.4.1) 67 | crass (1.0.6) 68 | date (3.4.0) 69 | drb (2.2.1) 70 | erubi (1.13.0) 71 | globalid (1.2.1) 72 | activesupport (>= 6.1) 73 | i18n (1.14.6) 74 | concurrent-ruby (~> 1.0) 75 | logger (1.6.1) 76 | loofah (2.23.1) 77 | crass (~> 1.0.2) 78 | nokogiri (>= 1.12.0) 79 | mail (2.9.0) 80 | logger 81 | mini_mime (>= 0.1.1) 82 | net-imap 83 | net-pop 84 | net-smtp 85 | mailcrate (0.0.6) 86 | mini_mime (1.1.5) 87 | mini_portile2 (2.8.8) 88 | minitest (5.25.4) 89 | minitest-rg (5.3.0) 90 | minitest (~> 5.0) 91 | mocha (2.5.0) 92 | ruby2_keywords (>= 0.0.5) 93 | mutex_m (0.2.0) 94 | net-imap (0.5.1) 95 | date 96 | net-protocol 97 | net-pop (0.1.2) 98 | net-protocol 99 | net-protocol (0.2.2) 100 | timeout 101 | net-smtp (0.5.0) 102 | net-protocol 103 | nokogiri (1.18.9) 104 | mini_portile2 (~> 2.8.2) 105 | racc (~> 1.4) 106 | racc (1.8.1) 107 | rack (3.2.3) 108 | rack-session (2.0.0) 109 | rack (>= 3.0.0) 110 | rack-test (2.1.0) 111 | rack (>= 1.3) 112 | rails-dom-testing (2.2.0) 113 | activesupport (>= 5.0.0) 114 | minitest 115 | nokogiri (>= 1.6) 116 | rails-html-sanitizer (1.6.0) 117 | loofah (~> 2.21) 118 | nokogiri (~> 1.14) 119 | rake (13.2.1) 120 | ruby2_keywords (0.0.5) 121 | securerandom (0.3.2) 122 | timeout (0.4.2) 123 | tzinfo (2.0.6) 124 | concurrent-ruby (~> 1.0) 125 | 126 | PLATFORMS 127 | ruby 128 | 129 | DEPENDENCIES 130 | action_mailer-logged_smtp_delivery! 131 | actionmailer (~> 7.1.0) 132 | bump 133 | byebug 134 | mailcrate 135 | minitest 136 | minitest-rg 137 | mocha 138 | rake 139 | 140 | BUNDLED WITH 141 | 2.6.2 142 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | action_mailer-logged_smtp_delivery (2.4.0) 5 | actionmailer (>= 6.1) 6 | globalid (>= 1.0.1) 7 | loofah (>= 2.19.1) 8 | mail 9 | net-smtp 10 | nokogiri (>= 1.13.9) 11 | rack (>= 2.2.6.4) 12 | rails-html-sanitizer (>= 1.4.4) 13 | 14 | GEM 15 | remote: https://rubygems.org/ 16 | specs: 17 | actionmailer (7.2.2.1) 18 | actionpack (= 7.2.2.1) 19 | actionview (= 7.2.2.1) 20 | activejob (= 7.2.2.1) 21 | activesupport (= 7.2.2.1) 22 | mail (>= 2.8.0) 23 | rails-dom-testing (~> 2.2) 24 | actionpack (7.2.2.1) 25 | actionview (= 7.2.2.1) 26 | activesupport (= 7.2.2.1) 27 | nokogiri (>= 1.8.5) 28 | racc 29 | rack (>= 2.2.4, < 3.2) 30 | rack-session (>= 1.0.1) 31 | rack-test (>= 0.6.3) 32 | rails-dom-testing (~> 2.2) 33 | rails-html-sanitizer (~> 1.6) 34 | useragent (~> 0.16) 35 | actionview (7.2.2.1) 36 | activesupport (= 7.2.2.1) 37 | builder (~> 3.1) 38 | erubi (~> 1.11) 39 | rails-dom-testing (~> 2.2) 40 | rails-html-sanitizer (~> 1.6) 41 | activejob (7.2.2.1) 42 | activesupport (= 7.2.2.1) 43 | globalid (>= 0.3.6) 44 | activesupport (7.2.2.1) 45 | base64 46 | benchmark (>= 0.3) 47 | bigdecimal 48 | concurrent-ruby (~> 1.0, >= 1.3.1) 49 | connection_pool (>= 2.2.5) 50 | drb 51 | i18n (>= 1.6, < 2) 52 | logger (>= 1.4.2) 53 | minitest (>= 5.1) 54 | securerandom (>= 0.3) 55 | tzinfo (~> 2.0, >= 2.0.5) 56 | base64 (0.3.0) 57 | benchmark (0.4.1) 58 | bigdecimal (3.2.2) 59 | builder (3.3.0) 60 | bump (0.10.0) 61 | byebug (11.1.3) 62 | concurrent-ruby (1.3.5) 63 | connection_pool (2.5.3) 64 | crass (1.0.6) 65 | date (3.4.1) 66 | drb (2.2.3) 67 | erubi (1.13.1) 68 | globalid (1.2.1) 69 | activesupport (>= 6.1) 70 | i18n (1.14.7) 71 | concurrent-ruby (~> 1.0) 72 | logger (1.7.0) 73 | loofah (2.24.1) 74 | crass (~> 1.0.2) 75 | nokogiri (>= 1.12.0) 76 | mail (2.9.0) 77 | logger 78 | mini_mime (>= 0.1.1) 79 | net-imap 80 | net-pop 81 | net-smtp 82 | mailcrate (0.0.6) 83 | mini_mime (1.1.5) 84 | mini_portile2 (2.8.9) 85 | minitest (5.25.4) 86 | minitest-rg (5.3.0) 87 | minitest (~> 5.0) 88 | mocha (2.5.0) 89 | ruby2_keywords (>= 0.0.5) 90 | net-imap (0.5.7) 91 | date 92 | net-protocol 93 | net-pop (0.1.2) 94 | net-protocol 95 | net-protocol (0.2.2) 96 | timeout 97 | net-smtp (0.5.0) 98 | net-protocol 99 | nokogiri (1.18.9) 100 | mini_portile2 (~> 2.8.2) 101 | racc (~> 1.4) 102 | racc (1.8.1) 103 | rack (3.1.18) 104 | rack-session (2.1.1) 105 | base64 (>= 0.1.0) 106 | rack (>= 3.0.0) 107 | rack-test (2.2.0) 108 | rack (>= 1.3) 109 | rails-dom-testing (2.3.0) 110 | activesupport (>= 5.0.0) 111 | minitest 112 | nokogiri (>= 1.6) 113 | rails-html-sanitizer (1.6.2) 114 | loofah (~> 2.21) 115 | nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) 116 | rake (13.2.1) 117 | ruby2_keywords (0.0.5) 118 | securerandom (0.4.1) 119 | timeout (0.4.3) 120 | tzinfo (2.0.6) 121 | concurrent-ruby (~> 1.0) 122 | useragent (0.16.11) 123 | 124 | PLATFORMS 125 | ruby 126 | 127 | DEPENDENCIES 128 | action_mailer-logged_smtp_delivery! 129 | bump 130 | byebug 131 | mailcrate 132 | minitest 133 | minitest-rg 134 | mocha 135 | rake 136 | 137 | BUNDLED WITH 138 | 2.6.2 139 | -------------------------------------------------------------------------------- /test/logged_smtp_delivery_test.rb: -------------------------------------------------------------------------------- 1 | require_relative 'helper' 2 | 3 | class LoggedSMTPDeliveryTest < Minitest::Test 4 | class TestMailer < ActionMailer::Base 5 | self.delivery_method = :logged_smtp 6 | 7 | def welcome(extra={}) 8 | mail({ 9 | "Message-ID" => '12345@example.com', 10 | "Date" => "2000-01-01", 11 | to: 'to@example.com', 12 | from: 'me@example.com', 13 | body: 'hello' 14 | }.merge(extra)) 15 | end 16 | end 17 | 18 | describe 'delivery' do 19 | let(:mail_file_logger) { MemoryLogger.new } 20 | let(:log) { StringIO.new } 21 | let(:logger) { 22 | logger = Logger.new(log) 23 | logger.formatter = lambda { |severity, datetime, progname, msg| msg } 24 | logger 25 | } 26 | let(:smtp) { Mailcrate.new(port) } 27 | let(:port) { 25552 } 28 | 29 | def mail 30 | count = 0 31 | until smtp.mails.any? || count > 4 32 | sleep 0.1 33 | count += 1 34 | end 35 | smtp.mails.last 36 | end 37 | 38 | before do 39 | TestMailer.logged_smtp_settings = { 40 | :port => port, 41 | :mail_file_logger => mail_file_logger, 42 | :logger => logger, 43 | :tls => false 44 | } 45 | smtp.start 46 | end 47 | 48 | after { smtp.stop } 49 | 50 | def without_file_logger 51 | original_logger = TestMailer.logged_smtp_settings[:mail_file_logger] 52 | TestMailer.logged_smtp_settings[:mail_file_logger] = nil 53 | yield 54 | ensure 55 | TestMailer.logged_smtp_settings[:mail_file_logger] = original_logger 56 | end 57 | 58 | it 'logs the mail to a file when the mail file logger is available' do 59 | TestMailer.welcome.deliver_now 60 | 61 | mime_version_header = if Gem::Version.new(Mail::VERSION::STRING) >= Gem::Version.new("2.9.0") 62 | "MIME-Version" 63 | else 64 | "Mime-Version" 65 | end 66 | 67 | message_id = if Gem::Version.new(Mail::VERSION::STRING) >= Gem::Version.new("2.8.0") 68 | "<12345@example.com>" 69 | else 70 | "12345@example.com" 71 | end 72 | 73 | assert_equal ["Date: Sat, 01 Jan 2000 00:00:00 +0000\r\nFrom: me@example.com\r\nTo: to@example.com\r\nMessage-ID: #{message_id}\r\nSubject: Welcome\r\n#{mime_version_header}: 1.0\r\nContent-Type: text/plain;\r\n charset=UTF-8\r\nContent-Transfer-Encoding: 7bit\r\n\r\nhello"], mail_file_logger.messages 74 | end 75 | 76 | it 'does not logs without file logger' do 77 | without_file_logger do 78 | TestMailer.welcome.deliver_now 79 | assert_equal [], mail_file_logger.messages 80 | end 81 | end 82 | 83 | it 'has the sender via the first from address' do 84 | TestMailer.welcome(:from => [ 'a@example.com', 'b@example.com' ]).deliver_now 85 | assert_equal '', mail[:from] 86 | end 87 | 88 | it 'enables tls by default' do 89 | mailer = ActionMailer::LoggedSMTPDelivery.new(TestMailer.logged_smtp_settings.merge(:tls => nil)) 90 | assert_equal true, mailer.settings[:tls] 91 | end 92 | 93 | it 'does not enable tls when disabled' do 94 | mailer = ActionMailer::LoggedSMTPDelivery.new(TestMailer.logged_smtp_settings) 95 | assert_equal false, mailer.settings[:tls] 96 | end 97 | 98 | it 'prefixes logs with the mail message id' do 99 | TestMailer.welcome.deliver_now 100 | assert_includes log.string, '12345@example.com stored at' 101 | end 102 | 103 | it 'does not log empty headers' do 104 | TestMailer.welcome.deliver_now 105 | refute_match(/^: \[/, log.string) 106 | end 107 | 108 | it 'logs headers when the log header is provided' do 109 | TestMailer.logged_smtp_settings[:log_header] = 'X-Delivery-Context' 110 | TestMailer.welcome('X-Delivery-Context' => 'hello-33').deliver_now 111 | assert_includes log.string, '12345@example.com X-Delivery-Context: [hello-33]' 112 | end 113 | 114 | it 'sends the mail' do 115 | TestMailer.welcome( 116 | :from => 'me@example.com', 117 | :to => 'to@example.com', 118 | :cc => 'cc@example.com', 119 | :body => 'hello' 120 | ).deliver_now 121 | 122 | mime_version_header = if Gem::Version.new(Mail::VERSION::STRING) >= Gem::Version.new("2.9.0") 123 | "MIME-Version" 124 | else 125 | "Mime-Version" 126 | end 127 | 128 | message_id = if Gem::Version.new(Mail::VERSION::STRING) >= Gem::Version.new("2.8.0") 129 | "<12345@example.com>" 130 | else 131 | "12345@example.com" 132 | end 133 | 134 | assert_equal "Date: Sat, 01 Jan 2000 00:00:00 +0000\nFrom: me@example.com\nTo: to@example.com\nCc: cc@example.com\nMessage-ID: #{message_id}\nSubject: Welcome\n#{mime_version_header}: 1.0\nContent-Type: text/plain;\n charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\nhello", mail[:body] 135 | assert_equal "", mail[:from] 136 | assert_equal ["", ""], mail[:to_list] 137 | end 138 | 139 | it 'does not include BCC addresses in the message' do 140 | TestMailer.welcome(:bcc => 'bcc@example.com').deliver_now 141 | refute_includes mail[:body], "bcc@example.com" 142 | end 143 | 144 | it 'sends to bcc addresses' do 145 | TestMailer.welcome(:bcc => 'bcc@example.com').deliver_now 146 | assert_includes mail[:to_list], "" 147 | end 148 | 149 | it 'contains the Net::SMTP::Response object in an instance variable' do 150 | mailer = ActionMailer::LoggedSMTPDelivery.new(TestMailer.logged_smtp_settings) 151 | mailer.send(:deliver!, TestMailer.welcome) 152 | 153 | _(mailer.response).must_be_kind_of Net::SMTP::Response 154 | _(mailer.response.status).must_equal '250' 155 | end 156 | 157 | describe 'delivery failures' do 158 | it 'logs any StandardError being thrown by the delivery method' do 159 | Net::SMTP.any_instance.stubs(:rcptto_list).raises(StandardError.new("kaboom")) 160 | assert_raises(StandardError) { TestMailer.welcome.deliver_now } 161 | assert_includes log.string, '12345@example.com exception #' 162 | refute_includes log.string, 'done' 163 | end 164 | end 165 | end 166 | end 167 | --------------------------------------------------------------------------------