actionmailbox 6.1.7.8 → 7.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -164
- data/MIT-LICENSE +1 -1
- data/app/controllers/action_mailbox/ingresses/relay/inbound_emails_controller.rb +1 -1
- data/app/controllers/rails/conductor/action_mailbox/incinerates_controller.rb +12 -0
- data/app/models/action_mailbox/inbound_email/message_id.rb +8 -4
- data/app/models/action_mailbox/inbound_email.rb +2 -2
- data/app/models/action_mailbox/record.rb +1 -1
- data/app/views/rails/conductor/action_mailbox/inbound_emails/show.html.erb +1 -1
- data/config/routes.rb +1 -0
- data/lib/action_mailbox/base.rb +2 -2
- data/lib/action_mailbox/engine.rb +3 -0
- data/lib/action_mailbox/gem_version.rb +4 -4
- data/lib/action_mailbox/mail_ext.rb +1 -1
- data/lib/action_mailbox.rb +1 -0
- metadata +23 -24
- data/lib/action_mailbox/mail_with_error_handling.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81b81cb09f0bed116b38808cb3c80f6b03c4be9a017e78dfeb7fe6ffaca6f42a
|
4
|
+
data.tar.gz: a938715e24c125482f39d9c3b780b2d9203432e286b59c8978666dbf2de235cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13620fcd40b8313862556cc0feb09fccab7e7a73ff54d5c6039aa1fe71d8f4e95221dcfaeca78e9f9ede31b3be6226d23ca4cdcfd51fec0e32e5a57b6dc5ec79
|
7
|
+
data.tar.gz: fd429260a2276a8c79bae48694077938e4cac19c729df1d419d02d51db571cbea23ed1d74057a636da0cb20412706cb8fc384651591178c63f57b0261ea61a5a
|
data/CHANGELOG.md
CHANGED
@@ -1,64 +1,4 @@
|
|
1
|
-
## Rails
|
2
|
-
|
3
|
-
* No changes.
|
4
|
-
|
5
|
-
|
6
|
-
## Rails 6.1.7.7 (February 21, 2024) ##
|
7
|
-
|
8
|
-
* No changes.
|
9
|
-
|
10
|
-
|
11
|
-
## Rails 6.1.7.6 (August 22, 2023) ##
|
12
|
-
|
13
|
-
* No changes.
|
14
|
-
|
15
|
-
|
16
|
-
## Rails 6.1.7.5 (August 22, 2023) ##
|
17
|
-
|
18
|
-
* No changes.
|
19
|
-
|
20
|
-
|
21
|
-
## Rails 6.1.7.4 (June 26, 2023) ##
|
22
|
-
|
23
|
-
* No changes.
|
24
|
-
|
25
|
-
|
26
|
-
## Rails 6.1.7.3 (March 13, 2023) ##
|
27
|
-
|
28
|
-
* No changes.
|
29
|
-
|
30
|
-
|
31
|
-
## Rails 6.1.7.2 (January 24, 2023) ##
|
32
|
-
|
33
|
-
* No changes.
|
34
|
-
|
35
|
-
|
36
|
-
## Rails 6.1.7.1 (January 17, 2023) ##
|
37
|
-
|
38
|
-
* No changes.
|
39
|
-
|
40
|
-
|
41
|
-
## Rails 6.1.7 (September 09, 2022) ##
|
42
|
-
|
43
|
-
* No changes.
|
44
|
-
|
45
|
-
|
46
|
-
## Rails 6.1.6.1 (July 12, 2022) ##
|
47
|
-
|
48
|
-
* No changes.
|
49
|
-
|
50
|
-
|
51
|
-
## Rails 6.1.6 (May 09, 2022) ##
|
52
|
-
|
53
|
-
* No changes.
|
54
|
-
|
55
|
-
|
56
|
-
## Rails 6.1.5.1 (April 26, 2022) ##
|
57
|
-
|
58
|
-
* No changes.
|
59
|
-
|
60
|
-
|
61
|
-
## Rails 6.1.5 (March 09, 2022) ##
|
1
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
62
2
|
|
63
3
|
* Add `attachments` to the list of permitted parameters for inbound emails conductor.
|
64
4
|
|
@@ -72,115 +12,29 @@
|
|
72
12
|
|
73
13
|
*David Jones*, *Dana Henke*
|
74
14
|
|
15
|
+
* Add ability to configure ActiveStorage service
|
16
|
+
for storing email raw source.
|
75
17
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
* No changes.
|
84
|
-
|
85
|
-
|
86
|
-
## Rails 6.1.4.5 (February 11, 2022) ##
|
87
|
-
|
88
|
-
* No changes.
|
89
|
-
|
90
|
-
|
91
|
-
## Rails 6.1.4.4 (December 15, 2021) ##
|
92
|
-
|
93
|
-
* No changes.
|
94
|
-
|
95
|
-
|
96
|
-
## Rails 6.1.4.3 (December 14, 2021) ##
|
97
|
-
|
98
|
-
* No changes.
|
99
|
-
|
100
|
-
|
101
|
-
## Rails 6.1.4.2 (December 14, 2021) ##
|
102
|
-
|
103
|
-
* No changes.
|
104
|
-
|
105
|
-
|
106
|
-
## Rails 6.1.4.1 (August 19, 2021) ##
|
107
|
-
|
108
|
-
* No changes.
|
109
|
-
|
110
|
-
|
111
|
-
## Rails 6.1.4 (June 24, 2021) ##
|
112
|
-
|
113
|
-
* No changes.
|
114
|
-
|
115
|
-
|
116
|
-
## Rails 6.1.3.2 (May 05, 2021) ##
|
117
|
-
|
118
|
-
* No changes.
|
119
|
-
|
120
|
-
|
121
|
-
## Rails 6.1.3.1 (March 26, 2021) ##
|
122
|
-
|
123
|
-
* No changes.
|
124
|
-
|
125
|
-
|
126
|
-
## Rails 6.1.3 (February 17, 2021) ##
|
127
|
-
|
128
|
-
* No changes.
|
129
|
-
|
130
|
-
|
131
|
-
## Rails 6.1.2.1 (February 10, 2021) ##
|
132
|
-
|
133
|
-
* No changes.
|
134
|
-
|
135
|
-
|
136
|
-
## Rails 6.1.2 (February 09, 2021) ##
|
137
|
-
|
138
|
-
* No changes.
|
139
|
-
|
140
|
-
|
141
|
-
## Rails 6.1.1 (January 07, 2021) ##
|
142
|
-
|
143
|
-
* No changes.
|
144
|
-
|
145
|
-
|
146
|
-
## Rails 6.1.0 (December 09, 2020) ##
|
147
|
-
|
148
|
-
* Change default queue name of the incineration (`:action_mailbox_incineration`) and
|
149
|
-
routing (`:action_mailbox_routing`) jobs to be the job adapter's default (`:default`).
|
150
|
-
|
151
|
-
*Rafael Mendonça França*
|
152
|
-
|
153
|
-
* Sendgrid ingress now passes through the envelope recipient as `X-Original-To`.
|
154
|
-
|
155
|
-
*Mark Haussmann*
|
156
|
-
|
157
|
-
* Update Mandrill inbound email route to respond appropriately to HEAD requests for URL health checks from Mandrill.
|
158
|
-
|
159
|
-
*Bill Cromie*
|
160
|
-
|
161
|
-
* Add way to deliver emails via source instead of filling out a form through the conductor interface.
|
162
|
-
|
163
|
-
*DHH*
|
164
|
-
|
165
|
-
* Mailgun ingress now passes through the envelope recipient as `X-Original-To`.
|
166
|
-
|
167
|
-
*Rikki Pitt*
|
168
|
-
|
169
|
-
* Deprecate `Rails.application.credentials.action_mailbox.api_key` and `MAILGUN_INGRESS_API_KEY` in favor of `Rails.application.credentials.action_mailbox.signing_key` and `MAILGUN_INGRESS_SIGNING_KEY`.
|
170
|
-
|
171
|
-
*Matthijs Vos*
|
18
|
+
```yml
|
19
|
+
# config/storage.yml
|
20
|
+
incoming_emails:
|
21
|
+
service: Disk
|
22
|
+
root: /secure/dir/for/emails/only
|
23
|
+
```
|
172
24
|
|
173
|
-
|
25
|
+
```ruby
|
26
|
+
config.action_mailbox.storage_service = :incoming_emails
|
27
|
+
```
|
174
28
|
|
175
|
-
*
|
29
|
+
*Yurii Rashkovskii*
|
176
30
|
|
177
|
-
*
|
31
|
+
* Add ability to incinerate an inbound message through the conductor interface.
|
178
32
|
|
179
|
-
*
|
33
|
+
*Santiago Bartesaghi*
|
180
34
|
|
181
|
-
*
|
35
|
+
* OpenSSL constants are now used for Digest computations.
|
182
36
|
|
183
|
-
*
|
37
|
+
*Dirkjan Bussink*
|
184
38
|
|
185
39
|
|
186
|
-
Please check [6-
|
40
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionmailbox/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Rails
|
4
|
+
# Incinerating will destroy an email that is due and has already been processed.
|
5
|
+
class Conductor::ActionMailbox::IncineratesController < Rails::Conductor::BaseController
|
6
|
+
def create
|
7
|
+
ActionMailbox::InboundEmail.find(params[:inbound_email_id]).incinerate
|
8
|
+
|
9
|
+
redirect_to main_app.rails_conductor_inbound_emails_url
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -14,12 +14,11 @@ module ActionMailbox::InboundEmail::MessageId
|
|
14
14
|
# attachment called +raw_email+. Before the upload, extract the Message-ID from the +source+ and set
|
15
15
|
# it as an attribute on the new +InboundEmail+.
|
16
16
|
def create_and_extract_message_id!(source, **options)
|
17
|
-
message_checksum = Digest::SHA1.hexdigest(source)
|
17
|
+
message_checksum = OpenSSL::Digest::SHA1.hexdigest(source)
|
18
18
|
message_id = extract_message_id(source) || generate_missing_message_id(message_checksum)
|
19
19
|
|
20
|
-
create!
|
21
|
-
|
22
|
-
end
|
20
|
+
create! raw_email: create_and_upload_raw_email!(source),
|
21
|
+
message_id: message_id, message_checksum: message_checksum, **options
|
23
22
|
rescue ActiveRecord::RecordNotUnique
|
24
23
|
nil
|
25
24
|
end
|
@@ -34,5 +33,10 @@ module ActionMailbox::InboundEmail::MessageId
|
|
34
33
|
logger.warn "Message-ID couldn't be parsed or is missing. Generated a new Message-ID: #{message_id}"
|
35
34
|
end
|
36
35
|
end
|
36
|
+
|
37
|
+
def create_and_upload_raw_email!(source)
|
38
|
+
ActiveStorage::Blob.create_and_upload! io: StringIO.new(source), filename: "message.eml", content_type: "message/rfc822",
|
39
|
+
service_name: ActionMailbox.storage_service
|
40
|
+
end
|
37
41
|
end
|
38
42
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "mail"
|
4
4
|
|
5
5
|
module ActionMailbox
|
6
6
|
# The +InboundEmail+ is an Active Record that keeps a reference to the raw email stored in Active Storage
|
@@ -29,7 +29,7 @@ module ActionMailbox
|
|
29
29
|
|
30
30
|
include Incineratable, MessageId, Routable
|
31
31
|
|
32
|
-
has_one_attached :raw_email
|
32
|
+
has_one_attached :raw_email, service: ActionMailbox.storage_service
|
33
33
|
enum status: %i[ pending processing delivered failed bounced ]
|
34
34
|
|
35
35
|
def mail
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<ul>
|
6
6
|
<li><%= button_to "Route again", main_app.rails_conductor_inbound_email_reroute_path(@inbound_email), method: :post %></li>
|
7
|
-
<li
|
7
|
+
<li><%= button_to "Incinerate", main_app.rails_conductor_inbound_email_incinerate_path(@inbound_email), method: :post %></li>
|
8
8
|
</ul>
|
9
9
|
|
10
10
|
<details>
|
data/config/routes.rb
CHANGED
@@ -21,5 +21,6 @@ Rails.application.routes.draw do
|
|
21
21
|
post "inbound_emails/sources", to: "inbound_emails/sources#create", as: :rails_conductor_inbound_email_sources
|
22
22
|
|
23
23
|
post ":inbound_email_id/reroute" => "reroutes#create", as: :rails_conductor_inbound_email_reroute
|
24
|
+
post ":inbound_email_id/incinerate" => "incinerates#create", as: :rails_conductor_inbound_email_incinerate
|
24
25
|
end
|
25
26
|
end
|
data/lib/action_mailbox/base.rb
CHANGED
@@ -77,7 +77,7 @@ module ActionMailbox
|
|
77
77
|
@inbound_email = inbound_email
|
78
78
|
end
|
79
79
|
|
80
|
-
def perform_processing
|
80
|
+
def perform_processing # :nodoc:
|
81
81
|
track_status_of_inbound_email do
|
82
82
|
run_callbacks :process do
|
83
83
|
process
|
@@ -92,7 +92,7 @@ module ActionMailbox
|
|
92
92
|
# Overwrite in subclasses
|
93
93
|
end
|
94
94
|
|
95
|
-
def finished_processing?
|
95
|
+
def finished_processing? # :nodoc:
|
96
96
|
inbound_email.delivered? || inbound_email.bounced?
|
97
97
|
end
|
98
98
|
|
@@ -20,6 +20,8 @@ module ActionMailbox
|
|
20
20
|
config.action_mailbox.queues = ActiveSupport::InheritableOptions.new \
|
21
21
|
incineration: :action_mailbox_incineration, routing: :action_mailbox_routing
|
22
22
|
|
23
|
+
config.action_mailbox.storage_service = nil
|
24
|
+
|
23
25
|
initializer "action_mailbox.config" do
|
24
26
|
config.after_initialize do |app|
|
25
27
|
ActionMailbox.logger = app.config.action_mailbox.logger || Rails.logger
|
@@ -27,6 +29,7 @@ module ActionMailbox
|
|
27
29
|
ActionMailbox.incinerate_after = app.config.action_mailbox.incinerate_after || 30.days
|
28
30
|
ActionMailbox.queues = app.config.action_mailbox.queues || {}
|
29
31
|
ActionMailbox.ingress = app.config.action_mailbox.ingress
|
32
|
+
ActionMailbox.storage_service = app.config.action_mailbox.storage_service
|
30
33
|
end
|
31
34
|
end
|
32
35
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "mail"
|
4
4
|
|
5
5
|
# The hope is to upstream most of these basic additions to the Mail gem's Mail object. But until then, here they lay!
|
6
6
|
Dir["#{File.expand_path(File.dirname(__FILE__))}/mail_ext/*"].each { |path| require "action_mailbox/mail_ext/#{File.basename(path)}" }
|
data/lib/action_mailbox.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmailbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.0.alpha1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
- George Claghorn
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-09-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -17,70 +17,70 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 7.0.0.alpha1
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 7.0.0.alpha1
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: activerecord
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - '='
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 7.0.0.alpha1
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - '='
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 7.0.0.alpha1
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: activestorage
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - '='
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 7.0.0.alpha1
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - '='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 7.0.0.alpha1
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: activejob
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - '='
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
62
|
+
version: 7.0.0.alpha1
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - '='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 7.0.0.alpha1
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: actionpack
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - '='
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
76
|
+
version: 7.0.0.alpha1
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - '='
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: 7.0.0.alpha1
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: mail
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- app/controllers/action_mailbox/ingresses/sendgrid/inbound_emails_controller.rb
|
115
115
|
- app/controllers/rails/conductor/action_mailbox/inbound_emails/sources_controller.rb
|
116
116
|
- app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb
|
117
|
+
- app/controllers/rails/conductor/action_mailbox/incinerates_controller.rb
|
117
118
|
- app/controllers/rails/conductor/action_mailbox/reroutes_controller.rb
|
118
119
|
- app/controllers/rails/conductor/base_controller.rb
|
119
120
|
- app/jobs/action_mailbox/incineration_job.rb
|
@@ -142,7 +143,6 @@ files:
|
|
142
143
|
- lib/action_mailbox/mail_ext/addresses.rb
|
143
144
|
- lib/action_mailbox/mail_ext/from_source.rb
|
144
145
|
- lib/action_mailbox/mail_ext/recipients.rb
|
145
|
-
- lib/action_mailbox/mail_with_error_handling.rb
|
146
146
|
- lib/action_mailbox/relayer.rb
|
147
147
|
- lib/action_mailbox/router.rb
|
148
148
|
- lib/action_mailbox/router/route.rb
|
@@ -164,12 +164,11 @@ licenses:
|
|
164
164
|
- MIT
|
165
165
|
metadata:
|
166
166
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
167
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
168
|
-
documentation_uri: https://api.rubyonrails.org/
|
167
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.0.alpha1/actionmailbox/CHANGELOG.md
|
168
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.0.alpha1/
|
169
169
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
170
|
-
source_code_uri: https://github.com/rails/rails/tree/
|
171
|
-
|
172
|
-
post_install_message:
|
170
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.0.alpha1/actionmailbox
|
171
|
+
post_install_message:
|
173
172
|
rdoc_options: []
|
174
173
|
require_paths:
|
175
174
|
- lib
|
@@ -177,15 +176,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
176
|
requirements:
|
178
177
|
- - ">="
|
179
178
|
- !ruby/object:Gem::Version
|
180
|
-
version: 2.
|
179
|
+
version: 2.7.0
|
181
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
181
|
requirements:
|
183
|
-
- - "
|
182
|
+
- - ">"
|
184
183
|
- !ruby/object:Gem::Version
|
185
|
-
version:
|
184
|
+
version: 1.3.1
|
186
185
|
requirements: []
|
187
|
-
rubygems_version: 3.
|
188
|
-
signing_key:
|
186
|
+
rubygems_version: 3.1.6
|
187
|
+
signing_key:
|
189
188
|
specification_version: 4
|
190
189
|
summary: Inbound email handling framework.
|
191
190
|
test_files: []
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
begin
|
4
|
-
require "mail"
|
5
|
-
rescue LoadError => error
|
6
|
-
if error.message.match?(/net\/smtp/)
|
7
|
-
$stderr.puts "You don't have net-smtp installed in your application. Please add it to your Gemfile and run bundle install"
|
8
|
-
raise
|
9
|
-
end
|
10
|
-
end
|