actionmailer 6.1.3.1 → 7.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionmailer might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e27c45adc95de9eacb6701d33de39f5202e313d4a592236eba043608b720c5a
4
- data.tar.gz: 535a8c3f783721eaf22f77053ea2234cfa2af43b6dcbf13ec70a290b3473984e
3
+ metadata.gz: 6159118c4a22077610712d15bf29827879bafebb249106a91745882e38a45554
4
+ data.tar.gz: ef51dca707ab5c296f62d4672672d39d439edcd6dd5e9ab4e7308eeb8b969e7d
5
5
  SHA512:
6
- metadata.gz: 1082cd48c55c4fa2c57fc5f734dbc9045ae36de07c7517da551a80ab7788a3534e9c197e6b184ff84167f637953671bddcfbde1c96fd873103ebd93b01dae11e
7
- data.tar.gz: c498ccefdc5c154a6d8f69bd5b01b947b22388c09b201ce1308bcaf53eeef2249d1f9246f484c717142b2372d6fac93e56fa75360f62722f50c96062fe91fc89
6
+ metadata.gz: 429027df6573b75fba33755ef047db4300dc218b316b12007f525a4448c9f10434c7dbfa42e43f25eb277e1e98ee5fc9cadff7d51730bd821f21a29e4d6777c0
7
+ data.tar.gz: f4b23b271e150623678ebd7a5208d853d8f2e7ecb5ed9856ed517f9249b5c12820524317f9bb0a4efbe50842c44b6a20a5386d47c25330ed112683cca6fc970c
data/CHANGELOG.md CHANGED
@@ -1,48 +1,8 @@
1
- ## Rails 6.1.3.1 (March 26, 2021) ##
1
+ ## Rails 7.0.0.alpha1 (September 15, 2021) ##
2
2
 
3
- * No changes.
3
+ * Configures a default of 5 for both `open_timeout` and `read_timeout` for SMTP Settings.
4
4
 
5
+ *André Luis Leal Cardoso Junior*
5
6
 
6
- ## Rails 6.1.3 (February 17, 2021) ##
7
7
 
8
- * No changes.
9
-
10
-
11
- ## Rails 6.1.2.1 (February 10, 2021) ##
12
-
13
- * No changes.
14
-
15
-
16
- ## Rails 6.1.2 (February 09, 2021) ##
17
-
18
- * No changes.
19
-
20
-
21
- ## Rails 6.1.1 (January 07, 2021) ##
22
-
23
- * Sets default mailer queue to `"default"` in the mail assertions.
24
-
25
- *Paul Keen*
26
-
27
-
28
- ## Rails 6.1.0 (December 09, 2020) ##
29
-
30
- * Change default queue name of the deliver (`:mailers`) job to be the job adapter's
31
- default (`:default`).
32
-
33
- *Rafael Mendonça França*
34
-
35
- * Remove deprecated `ActionMailer::Base.receive` in favor of [Action Mailbox](https://github.com/rails/rails/tree/master/actionmailbox).
36
-
37
- *Rafael Mendonça França*
38
-
39
- * Fix ActionMailer assertions don't work for parameterized mail with legacy delivery job.
40
-
41
- *bogdanvlviv*
42
-
43
- * Added `email_address_with_name` to properly escape addresses with names.
44
-
45
- *Sunny Ripert*
46
-
47
-
48
- Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionmailer/CHANGELOG.md) for previous changes.
8
+ Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionmailer/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2020 David Heinemeier Hansson
1
+ Copyright (c) 2004-2021 David Heinemeier Hansson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -409,6 +409,8 @@ module ActionMailer
409
409
  # of an OpenSSL verify constant (<tt>'none'</tt> or <tt>'peer'</tt>) or directly the constant
410
410
  # (<tt>OpenSSL::SSL::VERIFY_NONE</tt> or <tt>OpenSSL::SSL::VERIFY_PEER</tt>).
411
411
  # * <tt>:ssl/:tls</tt> Enables the SMTP connection to use SMTP/TLS (SMTPS: SMTP over direct TLS connection)
412
+ # * <tt>:open_timeout</tt> Number of seconds to wait while attempting to open a connection.
413
+ # * <tt>:read_timeout</tt> Number of seconds to wait until timing-out a read(2) call.
412
414
  #
413
415
  # * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method.
414
416
  # * <tt>:location</tt> - The location of the sendmail executable. Defaults to <tt>/usr/sbin/sendmail</tt>.
@@ -433,7 +435,7 @@ module ActionMailer
433
435
  # * <tt>deliveries</tt> - Keeps an array of all the emails sent out through the Action Mailer with
434
436
  # <tt>delivery_method :test</tt>. Most useful for unit and functional testing.
435
437
  #
436
- # * <tt>deliver_later_queue_name</tt> - The name of the queue used with <tt>deliver_later</tt>. Defaults to +mailers+.
438
+ # * <tt>deliver_later_queue_name</tt> - The name of the queue used with <tt>deliver_later</tt>.
437
439
  class Base < AbstractController::Base
438
440
  include DeliveryMethods
439
441
  include Rescuable
@@ -553,7 +555,7 @@ module ActionMailer
553
555
  # through a callback when you call <tt>:deliver</tt> on the <tt>Mail::Message</tt>,
554
556
  # calling +deliver_mail+ directly and passing a <tt>Mail::Message</tt> will do
555
557
  # nothing except tell the logger you sent the email.
556
- def deliver_mail(mail) #:nodoc:
558
+ def deliver_mail(mail) # :nodoc:
557
559
  ActiveSupport::Notifications.instrument("deliver.action_mailer") do |payload|
558
560
  set_payload_for_mail(payload, mail)
559
561
  yield # Let Mail do the delivery actions
@@ -589,7 +591,7 @@ module ActionMailer
589
591
  super
590
592
  end
591
593
  end
592
- ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
594
+ ruby2_keywords(:method_missing)
593
595
 
594
596
  def respond_to_missing?(method, include_all = false)
595
597
  action_methods.include?(method.to_s) || super
@@ -604,7 +606,7 @@ module ActionMailer
604
606
  @_message = Mail.new
605
607
  end
606
608
 
607
- def process(method_name, *args) #:nodoc:
609
+ def process(method_name, *args) # :nodoc:
608
610
  payload = {
609
611
  mailer: self.class.name,
610
612
  action: method_name,
@@ -617,7 +619,7 @@ module ActionMailer
617
619
  end
618
620
  end
619
621
 
620
- class NullMail #:nodoc:
622
+ class NullMail # :nodoc:
621
623
  def body; "" end
622
624
  def header; {} end
623
625
 
@@ -899,7 +901,7 @@ module ActionMailer
899
901
  end
900
902
 
901
903
  def apply_defaults(headers)
902
- default_values = self.class.default.transform_values do |value|
904
+ default_values = self.class.default.except(*headers.keys).transform_values do |value|
903
905
  compute_default(value)
904
906
  end
905
907
 
@@ -15,15 +15,15 @@ module ActionMailer
15
15
  before_perform do
16
16
  ActiveSupport::Deprecation.warn <<~MSG.squish
17
17
  Sending mail with DeliveryJob and Parameterized::DeliveryJob
18
- is deprecated and will be removed in Rails 6.2.
18
+ is deprecated and will be removed in Rails 7.0.
19
19
  Please use MailDeliveryJob instead.
20
20
  MSG
21
21
  end
22
22
 
23
- def perform(mailer, mail_method, delivery_method, *args) #:nodoc:
23
+ def perform(mailer, mail_method, delivery_method, *args) # :nodoc:
24
24
  mailer.constantize.public_send(mail_method, *args).send(delivery_method)
25
25
  end
26
- ruby2_keywords(:perform) if respond_to?(:ruby2_keywords, true)
26
+ ruby2_keywords(:perform)
27
27
 
28
28
  private
29
29
  # "Deserialize" the mailer class name by hand in case another argument
@@ -7,10 +7,10 @@ module ActionMailer
7
7
  end
8
8
 
9
9
  module VERSION
10
- MAJOR = 6
11
- MINOR = 1
12
- TINY = 3
13
- PRE = "1"
10
+ MAJOR = 7
11
+ MINOR = 0
12
+ TINY = 0
13
+ PRE = "alpha1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -17,15 +17,15 @@ module ActionMailer
17
17
 
18
18
  include Base64
19
19
 
20
- def self.previewing_email(message) #:nodoc:
20
+ def self.previewing_email(message) # :nodoc:
21
21
  new(message).transform!
22
22
  end
23
23
 
24
- def initialize(message) #:nodoc:
24
+ def initialize(message) # :nodoc:
25
25
  @message = message
26
26
  end
27
27
 
28
- def transform! #:nodoc:
28
+ def transform! # :nodoc:
29
29
  return message if html_part.blank?
30
30
 
31
31
  html_part.body = html_part.decoded.gsub(PATTERN) do |match|
@@ -15,7 +15,7 @@ module ActionMailer
15
15
  # Notifier.welcome(User.first).deliver_later # enqueue email delivery as a job through Active Job
16
16
  # Notifier.welcome(User.first).message # a Mail::Message object
17
17
  class MessageDelivery < Delegator
18
- def initialize(mailer_class, action, *args) #:nodoc:
18
+ def initialize(mailer_class, action, *args) # :nodoc:
19
19
  @mailer_class, @action, @args = mailer_class, action, args
20
20
 
21
21
  # The mail is only processed if we try to call any methods on it.
@@ -23,15 +23,15 @@ module ActionMailer
23
23
  @processed_mailer = nil
24
24
  @mail_message = nil
25
25
  end
26
- ruby2_keywords(:initialize) if respond_to?(:ruby2_keywords, true)
26
+ ruby2_keywords(:initialize)
27
27
 
28
28
  # Method calls are delegated to the Mail::Message that's ready to deliver.
29
- def __getobj__ #:nodoc:
29
+ def __getobj__ # :nodoc:
30
30
  @mail_message ||= processed_mailer.message
31
31
  end
32
32
 
33
33
  # Unused except for delegator internals (dup, marshalling).
34
- def __setobj__(mail_message) #:nodoc:
34
+ def __setobj__(mail_message) # :nodoc:
35
35
  @mail_message = mail_message
36
36
  end
37
37
 
@@ -150,7 +150,7 @@ module ActionMailer
150
150
  @mailer_class.name, @action.to_s, delivery_method.to_s, *@args)
151
151
  else
152
152
  ActiveSupport::Deprecation.warn(<<~EOM)
153
- In Rails 6.2, Action Mailer will pass the mail arguments inside the `:args` keyword argument.
153
+ In Rails 7.0, Action Mailer will pass the mail arguments inside the `:args` keyword argument.
154
154
  The `perform` method of the #{job} needs to change and forward the mail arguments
155
155
  from the `args` keyword argument.
156
156
 
@@ -115,7 +115,7 @@ module ActionMailer
115
115
  super
116
116
  end
117
117
  end
118
- ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
118
+ ruby2_keywords(:method_missing)
119
119
 
120
120
  def respond_to_missing?(method, include_all = false)
121
121
  @mailer.respond_to?(method, include_all)
@@ -126,7 +126,7 @@ module ActionMailer
126
126
  def perform(mailer, mail_method, delivery_method, params, *args)
127
127
  mailer.constantize.with(params).public_send(mail_method, *args).send(delivery_method)
128
128
  end
129
- ruby2_keywords(:perform) if respond_to?(:ruby2_keywords, true)
129
+ ruby2_keywords(:perform)
130
130
  end
131
131
 
132
132
  class MessageDelivery < ActionMailer::MessageDelivery # :nodoc:
@@ -134,7 +134,7 @@ module ActionMailer
134
134
  super(mailer_class, action, *args)
135
135
  @params = params
136
136
  end
137
- ruby2_keywords(:initialize) if respond_to?(:ruby2_keywords, true)
137
+ ruby2_keywords(:initialize)
138
138
 
139
139
  private
140
140
  def processed_mailer
@@ -3,7 +3,7 @@
3
3
  require "active_support/descendants_tracker"
4
4
 
5
5
  module ActionMailer
6
- module Previews #:nodoc:
6
+ module Previews # :nodoc:
7
7
  extend ActiveSupport::Concern
8
8
 
9
9
  included do
@@ -45,6 +45,15 @@ module ActionMailer
45
45
  self.delivery_job = delivery_job.constantize
46
46
  end
47
47
 
48
+ if smtp_settings = options.delete(:smtp_settings)
49
+ self.smtp_settings = smtp_settings
50
+ end
51
+
52
+ if smtp_timeout = options.delete(:smtp_timeout)
53
+ self.smtp_settings[:open_timeout] ||= smtp_timeout
54
+ self.smtp_settings[:read_timeout] ||= smtp_timeout
55
+ end
56
+
48
57
  options.each { |k, v| send("#{k}=", v) }
49
58
  end
50
59
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ActionMailer #:nodoc:
3
+ module ActionMailer # :nodoc:
4
4
  # Provides +rescue_from+ for mailers. Wraps mailer action processing,
5
5
  # mail job processing, and mail delivery.
6
6
  module Rescuable
@@ -8,12 +8,12 @@ module ActionMailer #:nodoc:
8
8
  include ActiveSupport::Rescuable
9
9
 
10
10
  class_methods do
11
- def handle_exception(exception) #:nodoc:
11
+ def handle_exception(exception) # :nodoc:
12
12
  rescue_with_handler(exception) || raise(exception)
13
13
  end
14
14
  end
15
15
 
16
- def handle_exceptions #:nodoc:
16
+ def handle_exceptions # :nodoc:
17
17
  yield
18
18
  rescue => exception
19
19
  rescue_with_handler(exception) || raise
data/lib/action_mailer.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # Copyright (c) 2004-2020 David Heinemeier Hansson
4
+ # Copyright (c) 2004-2021 David Heinemeier Hansson
5
5
  #
6
6
  # Permission is hereby granted, free of charge, to any person obtaining
7
7
  # a copy of this software and associated documentation files (the
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionmailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.3.1
4
+ version: 7.0.0.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-26 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 6.1.3.1
19
+ version: 7.0.0.alpha1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 6.1.3.1
26
+ version: 7.0.0.alpha1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 6.1.3.1
33
+ version: 7.0.0.alpha1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 6.1.3.1
40
+ version: 7.0.0.alpha1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: actionview
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 6.1.3.1
47
+ version: 7.0.0.alpha1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 6.1.3.1
54
+ version: 7.0.0.alpha1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activejob
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 6.1.3.1
61
+ version: 7.0.0.alpha1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 6.1.3.1
68
+ version: 7.0.0.alpha1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mail
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -137,10 +137,10 @@ licenses:
137
137
  - MIT
138
138
  metadata:
139
139
  bug_tracker_uri: https://github.com/rails/rails/issues
140
- changelog_uri: https://github.com/rails/rails/blob/v6.1.3.1/actionmailer/CHANGELOG.md
141
- documentation_uri: https://api.rubyonrails.org/v6.1.3.1/
140
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.0.alpha1/actionmailer/CHANGELOG.md
141
+ documentation_uri: https://api.rubyonrails.org/v7.0.0.alpha1/
142
142
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
143
- source_code_uri: https://github.com/rails/rails/tree/v6.1.3.1/actionmailer
143
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.0.alpha1/actionmailer
144
144
  post_install_message:
145
145
  rdoc_options: []
146
146
  require_paths:
@@ -149,15 +149,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: 2.5.0
152
+ version: 2.7.0
153
153
  required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  requirements:
155
- - - ">="
155
+ - - ">"
156
156
  - !ruby/object:Gem::Version
157
- version: '0'
157
+ version: 1.3.1
158
158
  requirements:
159
159
  - none
160
- rubygems_version: 3.1.2
160
+ rubygems_version: 3.1.6
161
161
  signing_key:
162
162
  specification_version: 4
163
163
  summary: Email composition and delivery framework (part of Rails).