actionmailbox 7.0.10 → 7.1.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -200
- data/MIT-LICENSE +1 -1
- data/README.md +2 -2
- data/app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb +1 -0
- data/app/controllers/action_mailbox/ingresses/postmark/inbound_emails_controller.rb +1 -0
- data/app/controllers/action_mailbox/ingresses/relay/inbound_emails_controller.rb +1 -1
- data/app/controllers/action_mailbox/ingresses/sendgrid/inbound_emails_controller.rb +1 -0
- data/app/controllers/rails/conductor/action_mailbox/inbound_emails/sources_controller.rb +3 -1
- data/app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb +2 -0
- data/app/controllers/rails/conductor/action_mailbox/incinerates_controller.rb +2 -0
- data/app/controllers/rails/conductor/action_mailbox/reroutes_controller.rb +2 -0
- data/app/models/action_mailbox/inbound_email/message_id.rb +1 -1
- data/app/models/action_mailbox/inbound_email.rb +8 -0
- data/app/views/rails/conductor/action_mailbox/inbound_emails/index.html.erb +3 -3
- data/config/routes.rb +1 -1
- data/db/migrate/20180917164000_create_action_mailbox_tables.rb +7 -1
- data/lib/action_mailbox/base.rb +24 -8
- data/lib/action_mailbox/callbacks.rb +2 -0
- data/lib/action_mailbox/deprecator.rb +7 -0
- data/lib/action_mailbox/engine.rb +4 -0
- data/lib/action_mailbox/gem_version.rb +4 -4
- data/lib/action_mailbox/mail_ext/addresses.rb +5 -1
- data/lib/action_mailbox/mail_ext/recipients.rb +2 -1
- data/lib/action_mailbox/router.rb +2 -0
- data/lib/action_mailbox/version.rb +1 -1
- data/lib/action_mailbox.rb +8 -0
- data/lib/rails/generators/mailbox/USAGE +1 -3
- data/lib/tasks/install.rake +1 -1
- metadata +22 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 22dd8d01edccd6360fc964c0e3a79338950ad8ef7c87eeb3fce1f5e4b2e8d266
|
|
4
|
+
data.tar.gz: c6957d1d5a3cd19c8f77be0696cb3478a663ad9e6ab1af466947a22dcb7c0bd4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 31c9a097037817519b40656857531585a8346ec82bf967ac1b5ca02ddc9ca7576c14524dfb5b2fd7d40514b4eaf034d589f1c948a8320e2ba5e9e76e98f55e68
|
|
7
|
+
data.tar.gz: e8cacf3a6618b13b82f1c48a8458bdf04590154c90ad84d3b8eec0aa031172e0248b8963088f86f9e3b120c77c4faeb0655c87ef8b14f2da0ff0d586fcfe8b67
|
data/CHANGELOG.md
CHANGED
|
@@ -1,210 +1,21 @@
|
|
|
1
|
-
## Rails 7.0.
|
|
1
|
+
## Rails 7.1.0.beta1 (September 13, 2023) ##
|
|
2
2
|
|
|
3
|
-
*
|
|
3
|
+
* Added `bounce_now_with` to send the bounce email without going through a mailer queue.
|
|
4
4
|
|
|
5
|
+
*Ronan Limon Duparcmeur*
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
* Support configured primary key types in generated migrations.
|
|
7
8
|
|
|
8
|
-
*
|
|
9
|
+
*Nishiki Liu*
|
|
9
10
|
|
|
11
|
+
* Fixed ingress controllers' ability to accept emails that contain no UTF-8 encoded parts.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Fixes #46297.
|
|
12
14
|
|
|
13
|
-
*
|
|
15
|
+
*Jan Honza Sterba*
|
|
14
16
|
|
|
17
|
+
* Add X-Forwarded-To addresses to recipients.
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
*Andrew Stewart*
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Rails 7.0.8.5 (October 15, 2024) ##
|
|
22
|
-
|
|
23
|
-
* No changes.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## Rails 7.0.8.4 (June 04, 2024) ##
|
|
27
|
-
|
|
28
|
-
* No changes.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Rails 7.0.8.3 (May 17, 2024) ##
|
|
32
|
-
|
|
33
|
-
* No changes.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
## Rails 7.0.8.2 (May 16, 2024) ##
|
|
37
|
-
|
|
38
|
-
* No changes.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## Rails 7.0.8.1 (February 21, 2024) ##
|
|
42
|
-
|
|
43
|
-
* No changes.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## Rails 7.0.8 (September 09, 2023) ##
|
|
47
|
-
|
|
48
|
-
* No changes.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## Rails 7.0.7.2 (August 22, 2023) ##
|
|
52
|
-
|
|
53
|
-
* No changes.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
## Rails 7.0.7.1 (August 22, 2023) ##
|
|
57
|
-
|
|
58
|
-
* No changes.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## Rails 7.0.7 (August 09, 2023) ##
|
|
62
|
-
|
|
63
|
-
* No changes.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
## Rails 7.0.6 (June 29, 2023) ##
|
|
67
|
-
|
|
68
|
-
* No changes.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
## Rails 7.0.5.1 (June 26, 2023) ##
|
|
72
|
-
|
|
73
|
-
* No changes.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## Rails 7.0.5 (May 24, 2023) ##
|
|
77
|
-
|
|
78
|
-
* No changes.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## Rails 7.0.4.3 (March 13, 2023) ##
|
|
82
|
-
|
|
83
|
-
* No changes.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
## Rails 7.0.4.2 (January 24, 2023) ##
|
|
87
|
-
|
|
88
|
-
* No changes.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
## Rails 7.0.4.1 (January 17, 2023) ##
|
|
92
|
-
|
|
93
|
-
* No changes.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## Rails 7.0.4 (September 09, 2022) ##
|
|
97
|
-
|
|
98
|
-
* No changes.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
## Rails 7.0.3.1 (July 12, 2022) ##
|
|
102
|
-
|
|
103
|
-
* No changes.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
## Rails 7.0.3 (May 09, 2022) ##
|
|
107
|
-
|
|
108
|
-
* No changes.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
## Rails 7.0.2.4 (April 26, 2022) ##
|
|
112
|
-
|
|
113
|
-
* No changes.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
## Rails 7.0.2.3 (March 08, 2022) ##
|
|
117
|
-
|
|
118
|
-
* No changes.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
## Rails 7.0.2.2 (February 11, 2022) ##
|
|
122
|
-
|
|
123
|
-
* No changes.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
## Rails 7.0.2.1 (February 11, 2022) ##
|
|
127
|
-
|
|
128
|
-
* No changes.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
## Rails 7.0.2 (February 08, 2022) ##
|
|
132
|
-
|
|
133
|
-
* No changes.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
## Rails 7.0.1 (January 06, 2022) ##
|
|
137
|
-
|
|
138
|
-
* No changes.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
## Rails 7.0.0 (December 15, 2021) ##
|
|
142
|
-
|
|
143
|
-
* No changes.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
## Rails 7.0.0.rc3 (December 14, 2021) ##
|
|
147
|
-
|
|
148
|
-
* No changes.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
## Rails 7.0.0.rc2 (December 14, 2021) ##
|
|
152
|
-
|
|
153
|
-
* No changes.
|
|
154
|
-
|
|
155
|
-
## Rails 7.0.0.rc1 (December 06, 2021) ##
|
|
156
|
-
|
|
157
|
-
* Removed deprecated environment variable `MAILGUN_INGRESS_API_KEY`.
|
|
158
|
-
|
|
159
|
-
*Rafael Mendonça França*
|
|
160
|
-
|
|
161
|
-
* Removed deprecated `Rails.application.credentials.action_mailbox.mailgun_api_key`.
|
|
162
|
-
|
|
163
|
-
*Rafael Mendonça França*
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
|
167
|
-
|
|
168
|
-
* No changes.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
172
|
-
|
|
173
|
-
* Add `attachments` to the list of permitted parameters for inbound emails conductor.
|
|
174
|
-
|
|
175
|
-
When using the conductor to test inbound emails with attachments, this prevents an
|
|
176
|
-
unpermitted parameter warning in default configurations, and prevents errors for
|
|
177
|
-
applications that set:
|
|
178
|
-
|
|
179
|
-
```ruby
|
|
180
|
-
config.action_controller.action_on_unpermitted_parameters = :raise
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
*David Jones*, *Dana Henke*
|
|
184
|
-
|
|
185
|
-
* Add ability to configure ActiveStorage service
|
|
186
|
-
for storing email raw source.
|
|
187
|
-
|
|
188
|
-
```yml
|
|
189
|
-
# config/storage.yml
|
|
190
|
-
incoming_emails:
|
|
191
|
-
service: Disk
|
|
192
|
-
root: /secure/dir/for/emails/only
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
```ruby
|
|
196
|
-
config.action_mailbox.storage_service = :incoming_emails
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
*Yurii Rashkovskii*
|
|
200
|
-
|
|
201
|
-
* Add ability to incinerate an inbound message through the conductor interface.
|
|
202
|
-
|
|
203
|
-
*Santiago Bartesaghi*
|
|
204
|
-
|
|
205
|
-
* OpenSSL constants are now used for Digest computations.
|
|
206
|
-
|
|
207
|
-
*Dirkjan Bussink*
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionmailbox/CHANGELOG.md) for previous changes.
|
|
21
|
+
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actionmailbox/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Action Mailbox
|
|
2
2
|
|
|
3
|
-
Action Mailbox routes incoming emails to controller-like mailboxes for processing in Rails. It ships with ingresses for Mailgun, Mandrill, Postmark, and SendGrid. You can also handle inbound mails directly via the built-in Exim, Postfix, and Qmail ingresses.
|
|
3
|
+
Action Mailbox routes incoming emails to controller-like mailboxes for processing in \Rails. It ships with ingresses for Mailgun, Mandrill, Postmark, and SendGrid. You can also handle inbound mails directly via the built-in Exim, Postfix, and Qmail ingresses.
|
|
4
4
|
|
|
5
5
|
The inbound emails are turned into `InboundEmail` records using Active Record and feature lifecycle tracking, storage of the original email on cloud storage via Active Storage, and responsible data handling with on-by-default incineration.
|
|
6
6
|
|
|
7
7
|
These inbound emails are routed asynchronously using Active Job to one or several dedicated mailboxes, which are capable of interacting directly with the rest of your domain model.
|
|
8
8
|
|
|
9
|
-
You can read more about Action Mailbox in the [Action Mailbox Basics](https://
|
|
9
|
+
You can read more about Action Mailbox in the [Action Mailbox Basics](https://guides.rubyonrails.org/action_mailbox_basics.html) guide.
|
|
10
10
|
|
|
11
11
|
## License
|
|
12
12
|
|
|
@@ -44,6 +44,7 @@ module ActionMailbox
|
|
|
44
44
|
# <tt>https://example.com/rails/action_mailbox/mailgun/inbound_emails/mime</tt>.
|
|
45
45
|
class Ingresses::Mailgun::InboundEmailsController < ActionMailbox::BaseController
|
|
46
46
|
before_action :authenticate
|
|
47
|
+
param_encoding :create, "body-mime", Encoding::ASCII_8BIT
|
|
47
48
|
|
|
48
49
|
def create
|
|
49
50
|
ActionMailbox::InboundEmail.create_and_extract_message_id! mail
|
|
@@ -46,6 +46,7 @@ module ActionMailbox
|
|
|
46
46
|
# content in JSON payload"*. Action Mailbox needs the raw email content to work.
|
|
47
47
|
class Ingresses::Postmark::InboundEmailsController < ActionMailbox::BaseController
|
|
48
48
|
before_action :authenticate_by_password
|
|
49
|
+
param_encoding :create, "RawEmail", Encoding::ASCII_8BIT
|
|
49
50
|
|
|
50
51
|
def create
|
|
51
52
|
ActionMailbox::InboundEmail.create_and_extract_message_id! params.require("RawEmail")
|
|
@@ -41,7 +41,7 @@ module ActionMailbox
|
|
|
41
41
|
# If your application lives at <tt>https://example.com</tt>, you would configure the Postfix SMTP server to pipe
|
|
42
42
|
# inbound emails to the following command:
|
|
43
43
|
#
|
|
44
|
-
#
|
|
44
|
+
# bin/rails action_mailbox:ingress:postfix URL=https://example.com/rails/action_mailbox/postfix/inbound_emails INGRESS_PASSWORD=...
|
|
45
45
|
#
|
|
46
46
|
# Built-in ingress commands are available for these popular SMTP servers:
|
|
47
47
|
#
|
|
@@ -46,6 +46,7 @@ module ActionMailbox
|
|
|
46
46
|
# full MIME message."* Action Mailbox needs the raw MIME message to work.
|
|
47
47
|
class Ingresses::Sendgrid::InboundEmailsController < ActionMailbox::BaseController
|
|
48
48
|
before_action :authenticate_by_password
|
|
49
|
+
param_encoding :create, :email, Encoding::ASCII_8BIT
|
|
49
50
|
|
|
50
51
|
def create
|
|
51
52
|
ActionMailbox::InboundEmail.create_and_extract_message_id! mail
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# :enddoc:
|
|
4
|
+
|
|
3
5
|
module Rails
|
|
4
|
-
class Conductor::ActionMailbox::InboundEmails::SourcesController < Rails::Conductor::BaseController
|
|
6
|
+
class Conductor::ActionMailbox::InboundEmails::SourcesController < Rails::Conductor::BaseController # :nodoc:
|
|
5
7
|
def new
|
|
6
8
|
end
|
|
7
9
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# web request.
|
|
6
6
|
#
|
|
7
7
|
# If an inbound email does not, against the rfc822 mandate, specify a Message-ID, one will be generated
|
|
8
|
-
# using the approach from
|
|
8
|
+
# using the approach from +Mail::MessageIdField+.
|
|
9
9
|
module ActionMailbox::InboundEmail::MessageId
|
|
10
10
|
extend ActiveSupport::Concern
|
|
11
11
|
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
<h1>All inbound emails</h1>
|
|
4
4
|
|
|
5
|
+
<%= link_to "New inbound email by form", main_app.new_rails_conductor_inbound_email_path %> |
|
|
6
|
+
<%= link_to "New inbound email by source", main_app.new_rails_conductor_inbound_email_source_path %>
|
|
7
|
+
|
|
5
8
|
<table>
|
|
6
9
|
<tr><th>Message ID</th><th>Status</th></tr>
|
|
7
10
|
<% @inbound_emails.each do |inbound_email| %>
|
|
@@ -11,6 +14,3 @@
|
|
|
11
14
|
</tr>
|
|
12
15
|
<% end %>
|
|
13
16
|
</table>
|
|
14
|
-
|
|
15
|
-
<%= link_to "New inbound email by form", main_app.new_rails_conductor_inbound_email_path %> |
|
|
16
|
-
<%= link_to "New inbound email by source", main_app.new_rails_conductor_inbound_email_source_path %>
|
data/config/routes.rb
CHANGED
|
@@ -16,7 +16,7 @@ Rails.application.routes.draw do
|
|
|
16
16
|
|
|
17
17
|
# TODO: Should these be mounted within the engine only?
|
|
18
18
|
scope "rails/conductor/action_mailbox/", module: "rails/conductor/action_mailbox" do
|
|
19
|
-
resources :inbound_emails, as: :rails_conductor_inbound_emails
|
|
19
|
+
resources :inbound_emails, as: :rails_conductor_inbound_emails, only: %i[index new show create]
|
|
20
20
|
get "inbound_emails/sources/new", to: "inbound_emails/sources#new", as: :new_rails_conductor_inbound_email_source
|
|
21
21
|
post "inbound_emails/sources", to: "inbound_emails/sources#create", as: :rails_conductor_inbound_email_sources
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
class CreateActionMailboxTables < ActiveRecord::Migration[6.0]
|
|
2
2
|
def change
|
|
3
|
-
create_table :action_mailbox_inbound_emails do |t|
|
|
3
|
+
create_table :action_mailbox_inbound_emails, id: primary_key_type do |t|
|
|
4
4
|
t.integer :status, default: 0, null: false
|
|
5
5
|
t.string :message_id, null: false
|
|
6
6
|
t.string :message_checksum, null: false
|
|
@@ -10,4 +10,10 @@ class CreateActionMailboxTables < ActiveRecord::Migration[6.0]
|
|
|
10
10
|
t.index [ :message_id, :message_checksum ], name: "index_action_mailbox_inbound_emails_uniqueness", unique: true
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
def primary_key_type
|
|
16
|
+
config = Rails.configuration.generators
|
|
17
|
+
config.options[config.orm][:primary_key_type] || :primary_key
|
|
18
|
+
end
|
|
13
19
|
end
|
data/lib/action_mailbox/base.rb
CHANGED
|
@@ -6,6 +6,8 @@ require "action_mailbox/callbacks"
|
|
|
6
6
|
require "action_mailbox/routing"
|
|
7
7
|
|
|
8
8
|
module ActionMailbox
|
|
9
|
+
# = Action Mailbox \Base
|
|
10
|
+
#
|
|
9
11
|
# The base class for all application mailboxes. Not intended to be inherited from directly. Inherit from
|
|
10
12
|
# +ApplicationMailbox+ instead, as that's where the app-specific routing is configured. This routing
|
|
11
13
|
# is specified in the following ways:
|
|
@@ -29,7 +31,7 @@ module ActionMailbox
|
|
|
29
31
|
#
|
|
30
32
|
# Application mailboxes need to override the #process method, which is invoked by the framework after
|
|
31
33
|
# callbacks have been run. The callbacks available are: +before_processing+, +after_processing+, and
|
|
32
|
-
# +around_processing+. The primary use case is ensure certain preconditions to processing are fulfilled
|
|
34
|
+
# +around_processing+. The primary use case is to ensure that certain preconditions to processing are fulfilled
|
|
33
35
|
# using +before_processing+ callbacks.
|
|
34
36
|
#
|
|
35
37
|
# If a precondition fails to be met, you can halt the processing using the +#bounced!+ method,
|
|
@@ -79,14 +81,16 @@ module ActionMailbox
|
|
|
79
81
|
end
|
|
80
82
|
|
|
81
83
|
def perform_processing # :nodoc:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
process
|
|
84
|
+
ActiveSupport::Notifications.instrument "process.action_mailbox", instrumentation_payload do
|
|
85
|
+
track_status_of_inbound_email do
|
|
86
|
+
run_callbacks :process do
|
|
87
|
+
process
|
|
88
|
+
end
|
|
85
89
|
end
|
|
90
|
+
rescue => exception
|
|
91
|
+
# TODO: Include a reference to the inbound_email in the exception raised so error handling becomes easier
|
|
92
|
+
rescue_with_handler(exception) || raise
|
|
86
93
|
end
|
|
87
|
-
rescue => exception
|
|
88
|
-
# TODO: Include a reference to the inbound_email in the exception raised so error handling becomes easier
|
|
89
|
-
rescue_with_handler(exception) || raise
|
|
90
94
|
end
|
|
91
95
|
|
|
92
96
|
def process
|
|
@@ -97,14 +101,26 @@ module ActionMailbox
|
|
|
97
101
|
inbound_email.delivered? || inbound_email.bounced?
|
|
98
102
|
end
|
|
99
103
|
|
|
100
|
-
|
|
101
104
|
# Enqueues the given +message+ for delivery and changes the inbound email's status to +:bounced+.
|
|
102
105
|
def bounce_with(message)
|
|
103
106
|
inbound_email.bounced!
|
|
104
107
|
message.deliver_later
|
|
105
108
|
end
|
|
106
109
|
|
|
110
|
+
# Immediately sends the given +message+ and changes the inbound email's status to +:bounced+.
|
|
111
|
+
def bounce_now_with(message)
|
|
112
|
+
inbound_email.bounced!
|
|
113
|
+
message.deliver_now
|
|
114
|
+
end
|
|
115
|
+
|
|
107
116
|
private
|
|
117
|
+
def instrumentation_payload
|
|
118
|
+
{
|
|
119
|
+
mailbox: self,
|
|
120
|
+
inbound_email: inbound_email.instrumentation_payload
|
|
121
|
+
}
|
|
122
|
+
end
|
|
123
|
+
|
|
108
124
|
def track_status_of_inbound_email
|
|
109
125
|
inbound_email.processing!
|
|
110
126
|
yield
|
|
@@ -22,6 +22,10 @@ module ActionMailbox
|
|
|
22
22
|
|
|
23
23
|
config.action_mailbox.storage_service = nil
|
|
24
24
|
|
|
25
|
+
initializer "action_mailbox.deprecator", before: :load_environment_config do |app|
|
|
26
|
+
app.deprecators[:action_mailbox] = ActionMailbox.deprecator
|
|
27
|
+
end
|
|
28
|
+
|
|
25
29
|
initializer "action_mailbox.config" do
|
|
26
30
|
config.after_initialize do |app|
|
|
27
31
|
ActionMailbox.logger = app.config.action_mailbox.logger || Rails.logger
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module ActionMailbox
|
|
4
|
-
# Returns the currently loaded version of Action Mailbox as a
|
|
4
|
+
# Returns the currently loaded version of Action Mailbox as a +Gem::Version+.
|
|
5
5
|
def self.gem_version
|
|
6
6
|
Gem::Version.new VERSION::STRING
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
module VERSION
|
|
10
10
|
MAJOR = 7
|
|
11
|
-
MINOR =
|
|
12
|
-
TINY =
|
|
13
|
-
PRE =
|
|
11
|
+
MINOR = 1
|
|
12
|
+
TINY = 0
|
|
13
|
+
PRE = "beta1"
|
|
14
14
|
|
|
15
15
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
|
16
16
|
end
|
|
@@ -7,7 +7,7 @@ module Mail
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def recipients_addresses
|
|
10
|
-
to_addresses + cc_addresses + bcc_addresses + x_original_to_addresses
|
|
10
|
+
to_addresses + cc_addresses + bcc_addresses + x_original_to_addresses + x_forwarded_to_addresses
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def to_addresses
|
|
@@ -26,6 +26,10 @@ module Mail
|
|
|
26
26
|
Array(header[:x_original_to]).collect { |header| Mail::Address.new header.to_s }
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
def x_forwarded_to_addresses
|
|
30
|
+
Array(header[:x_forwarded_to]).collect { |header| Mail::Address.new header.to_s }
|
|
31
|
+
end
|
|
32
|
+
|
|
29
33
|
private
|
|
30
34
|
def address_list(obj)
|
|
31
35
|
if obj&.respond_to?(:element)
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
module Mail
|
|
4
4
|
class Message
|
|
5
5
|
def recipients
|
|
6
|
-
Array(to) + Array(cc) + Array(bcc) + Array(header[:x_original_to]).map(&:to_s)
|
|
6
|
+
Array(to) + Array(cc) + Array(bcc) + Array(header[:x_original_to]).map(&:to_s) +
|
|
7
|
+
Array(header[:x_forwarded_to]).map(&:to_s)
|
|
7
8
|
end
|
|
8
9
|
end
|
|
9
10
|
end
|
data/lib/action_mailbox.rb
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "active_support"
|
|
4
|
+
require "active_support/rails"
|
|
5
|
+
require "active_support/core_ext/numeric/time"
|
|
6
|
+
|
|
7
|
+
require "action_mailbox/version"
|
|
8
|
+
require "action_mailbox/deprecator"
|
|
3
9
|
require "action_mailbox/mail_ext"
|
|
4
10
|
|
|
11
|
+
# :markup: markdown
|
|
12
|
+
# :include: actionmailbox/README.md
|
|
5
13
|
module ActionMailbox
|
|
6
14
|
extend ActiveSupport::Autoload
|
|
7
15
|
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
Description:
|
|
2
|
-
============
|
|
3
2
|
Generates a new mailbox class in app/mailboxes and invokes your template
|
|
4
3
|
engine and test framework generators.
|
|
5
4
|
|
|
6
5
|
Example:
|
|
7
|
-
|
|
8
|
-
bin/rails generate mailbox inbox
|
|
6
|
+
`bin/rails generate mailbox inbox`
|
|
9
7
|
|
|
10
8
|
creates an InboxMailbox class and test:
|
|
11
9
|
Mailbox: app/mailboxes/inbox_mailbox.rb
|
data/lib/tasks/install.rake
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: actionmailbox
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.0.
|
|
4
|
+
version: 7.1.0.beta1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Heinemeier Hansson
|
|
8
8
|
- George Claghorn
|
|
9
|
+
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
+
date: 2023-09-13 00:00:00.000000000 Z
|
|
12
13
|
dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
|
14
15
|
name: activesupport
|
|
@@ -16,70 +17,70 @@ dependencies:
|
|
|
16
17
|
requirements:
|
|
17
18
|
- - '='
|
|
18
19
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 7.0.
|
|
20
|
+
version: 7.1.0.beta1
|
|
20
21
|
type: :runtime
|
|
21
22
|
prerelease: false
|
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
24
|
requirements:
|
|
24
25
|
- - '='
|
|
25
26
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 7.0.
|
|
27
|
+
version: 7.1.0.beta1
|
|
27
28
|
- !ruby/object:Gem::Dependency
|
|
28
29
|
name: activerecord
|
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
|
30
31
|
requirements:
|
|
31
32
|
- - '='
|
|
32
33
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 7.0.
|
|
34
|
+
version: 7.1.0.beta1
|
|
34
35
|
type: :runtime
|
|
35
36
|
prerelease: false
|
|
36
37
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
38
|
requirements:
|
|
38
39
|
- - '='
|
|
39
40
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 7.0.
|
|
41
|
+
version: 7.1.0.beta1
|
|
41
42
|
- !ruby/object:Gem::Dependency
|
|
42
43
|
name: activestorage
|
|
43
44
|
requirement: !ruby/object:Gem::Requirement
|
|
44
45
|
requirements:
|
|
45
46
|
- - '='
|
|
46
47
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 7.0.
|
|
48
|
+
version: 7.1.0.beta1
|
|
48
49
|
type: :runtime
|
|
49
50
|
prerelease: false
|
|
50
51
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
52
|
requirements:
|
|
52
53
|
- - '='
|
|
53
54
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 7.0.
|
|
55
|
+
version: 7.1.0.beta1
|
|
55
56
|
- !ruby/object:Gem::Dependency
|
|
56
57
|
name: activejob
|
|
57
58
|
requirement: !ruby/object:Gem::Requirement
|
|
58
59
|
requirements:
|
|
59
60
|
- - '='
|
|
60
61
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 7.0.
|
|
62
|
+
version: 7.1.0.beta1
|
|
62
63
|
type: :runtime
|
|
63
64
|
prerelease: false
|
|
64
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
66
|
requirements:
|
|
66
67
|
- - '='
|
|
67
68
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: 7.0.
|
|
69
|
+
version: 7.1.0.beta1
|
|
69
70
|
- !ruby/object:Gem::Dependency
|
|
70
71
|
name: actionpack
|
|
71
72
|
requirement: !ruby/object:Gem::Requirement
|
|
72
73
|
requirements:
|
|
73
74
|
- - '='
|
|
74
75
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 7.0.
|
|
76
|
+
version: 7.1.0.beta1
|
|
76
77
|
type: :runtime
|
|
77
78
|
prerelease: false
|
|
78
79
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
80
|
requirements:
|
|
80
81
|
- - '='
|
|
81
82
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 7.0.
|
|
83
|
+
version: 7.1.0.beta1
|
|
83
84
|
- !ruby/object:Gem::Dependency
|
|
84
85
|
name: mail
|
|
85
86
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -176,6 +177,7 @@ files:
|
|
|
176
177
|
- lib/action_mailbox.rb
|
|
177
178
|
- lib/action_mailbox/base.rb
|
|
178
179
|
- lib/action_mailbox/callbacks.rb
|
|
180
|
+
- lib/action_mailbox/deprecator.rb
|
|
179
181
|
- lib/action_mailbox/engine.rb
|
|
180
182
|
- lib/action_mailbox/gem_version.rb
|
|
181
183
|
- lib/action_mailbox/mail_ext.rb
|
|
@@ -205,11 +207,12 @@ licenses:
|
|
|
205
207
|
- MIT
|
|
206
208
|
metadata:
|
|
207
209
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
|
208
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.
|
|
209
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.
|
|
210
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.1.0.beta1/actionmailbox/CHANGELOG.md
|
|
211
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.0.beta1/
|
|
210
212
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
|
211
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.
|
|
213
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.1.0.beta1/actionmailbox
|
|
212
214
|
rubygems_mfa_required: 'true'
|
|
215
|
+
post_install_message:
|
|
213
216
|
rdoc_options: []
|
|
214
217
|
require_paths:
|
|
215
218
|
- lib
|
|
@@ -220,11 +223,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
220
223
|
version: 2.7.0
|
|
221
224
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
225
|
requirements:
|
|
223
|
-
- - "
|
|
226
|
+
- - ">"
|
|
224
227
|
- !ruby/object:Gem::Version
|
|
225
|
-
version:
|
|
228
|
+
version: 1.3.1
|
|
226
229
|
requirements: []
|
|
227
|
-
rubygems_version: 3.
|
|
230
|
+
rubygems_version: 3.4.18
|
|
231
|
+
signing_key:
|
|
228
232
|
specification_version: 4
|
|
229
233
|
summary: Inbound email handling framework.
|
|
230
234
|
test_files: []
|