mail2cb 0.0.6 → 0.0.8
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/.rspec +2 -0
- data/Dockerfile +37 -0
- data/README.md +13 -0
- data/Rakefile +11 -0
- data/bin/mail2cb +25 -6
- data/bin/run +36 -0
- data/lib/mail2cb/{email_body_parser.rb → email_body_cleanser.rb} +1 -1
- data/lib/mail2cb/email_content.rb +44 -0
- data/lib/mail2cb/email_handler.rb +89 -61
- data/lib/mail2cb/email_watcher.rb +78 -14
- data/lib/mail2cb/encryption.rb +44 -25
- data/lib/mail2cb/message_id_handler.rb +63 -0
- data/lib/mail2cb/version.rb +1 -1
- data/lib/mail2cb.rb +4 -1
- data/mail2cb.gemspec +10 -4
- data/samples/bare_bones.txt +5 -0
- data/samples/reply.txt +226 -0
- data/samples/reply_message_id_in_body.txt +416 -0
- data/samples/reply_with_cc.txt +455 -0
- data/spec/hash_key_matcher.rb +22 -0
- data/spec/helpers.rb +14 -0
- data/spec/mail2cb/email_content_spec.rb +27 -0
- data/spec/mail2cb/email_handler_spec.rb +190 -0
- data/spec/mail2cb/email_watcher_spec.rb +61 -0
- data/spec/mail2cb/encryption_spec.rb +47 -0
- data/spec/mail2cb/message_id_handler_spec.rb +35 -0
- data/spec/spec_helper.rb +15 -0
- metadata +109 -13
@@ -0,0 +1,190 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe Mail2cb::EmailHandler do
|
3
|
+
|
4
|
+
before(:each) do
|
5
|
+
ENV.delete("AWS_ACCESS_KEY")
|
6
|
+
ENV.delete("AWS_SECRET_KEY")
|
7
|
+
ENV.delete("AWS_MAILROOM_BUCKET")
|
8
|
+
|
9
|
+
@simple = sample_mail("reply")
|
10
|
+
@bare_bones = sample_mail("bare_bones")
|
11
|
+
@multipart_related = sample_mail("reply_message_id_in_body")
|
12
|
+
@email = Mail.new(@simple)
|
13
|
+
@handler = Mail2cb::EmailHandler.new(:inbound_message => @simple, :mailbox => {:account_code => "test_account_code"})
|
14
|
+
end
|
15
|
+
|
16
|
+
it "verifies :inbound_message is passed in" do
|
17
|
+
expect{Mail2cb::EmailHandler.new(:mailbox => nil)}.to raise_error(RuntimeError, "Require :inbound_message to be passed in")
|
18
|
+
end
|
19
|
+
it "verifies :mailbox is passed in" do
|
20
|
+
expect{Mail2cb::EmailHandler.new(:inbound_message => nil)}.to raise_error(RuntimeError, "Require :mailbox to be passed in")
|
21
|
+
end
|
22
|
+
|
23
|
+
it "parses the email to an email object" do
|
24
|
+
email = @handler.email
|
25
|
+
|
26
|
+
expect(email).to be_an_instance_of Mail::Message
|
27
|
+
expect(email.from).to eq ["stewart@emergeadapt.com"]
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "message hash for commsroom" do
|
32
|
+
it "generates valid message hash" do
|
33
|
+
expected_hash = {
|
34
|
+
"from" => {
|
35
|
+
:email => "",
|
36
|
+
:display_name => "",
|
37
|
+
:account_code => ""},
|
38
|
+
"subject" => "",
|
39
|
+
"sent_at" => "",
|
40
|
+
"received_at" => "",
|
41
|
+
"body" => "",
|
42
|
+
"attachments"=>[
|
43
|
+
{
|
44
|
+
"filename"=>"",
|
45
|
+
"filepath"=>"",
|
46
|
+
"storage_type"=>nil
|
47
|
+
}
|
48
|
+
],
|
49
|
+
"metadata" => {
|
50
|
+
"has_bounced" => "",
|
51
|
+
"in_reply_to" => "",
|
52
|
+
"message_id" => "",
|
53
|
+
"account_code" => "",
|
54
|
+
"references"=>[],
|
55
|
+
"conversation_id"=>""
|
56
|
+
},
|
57
|
+
"to" => [
|
58
|
+
{
|
59
|
+
:email=>"",
|
60
|
+
:display_name=>"",
|
61
|
+
:account_code=>""
|
62
|
+
}
|
63
|
+
]
|
64
|
+
}
|
65
|
+
expect(@handler.generate_message_hash).to match_keys_to(expected_hash)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
describe "recipients" do
|
70
|
+
it "are formatted correctly" do
|
71
|
+
expected_hash = {:email=>"stewart@emergeadapt.com",:display_name=>"Stewart McKee",:account_code=>"test_account_code"}
|
72
|
+
|
73
|
+
address = Mail::Address.new("Stewart McKee <stewart@emergeadapt.com>")
|
74
|
+
expect(@handler.format_recipient(address)).to eq expected_hash
|
75
|
+
end
|
76
|
+
it "handle comments in local" do
|
77
|
+
expected_hash = {:email=>"stewart@emergeadapt.com",:display_name=>"Stewart McKee",:account_code=>"test_account_code"}
|
78
|
+
|
79
|
+
address = Mail::Address.new("Stewart McKee (coder) <stewart@emergeadapt.com>")
|
80
|
+
expect(@handler.format_recipient(address)).to eq expected_hash
|
81
|
+
end
|
82
|
+
it "handle comments in domain" do
|
83
|
+
expected_hash = {:email=>"stewart@emergeadapt.com",:display_name=>"Stewart McKee",:account_code=>"test_account_code"}
|
84
|
+
|
85
|
+
address = Mail::Address.new("Stewart McKee <stewart@emergeadapt(super_company).com>")
|
86
|
+
expect(@handler.format_recipient(address)).to eq expected_hash
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "message metadata" do
|
91
|
+
it "extracts the correct metadata from mail" do
|
92
|
+
expected_hash = {"has_bounced"=>nil, "in_reply_to"=>"conversation.570f77bc81e9a825e2000001.570f7a1381e9a82659000001@mail.caseblocks.com", "message_id"=>"etPan.570f7a6d.7b5aa127.137@emergeadapt.com", "account_code"=>"test_account_code", "references"=>["conversation.570f77bc81e9a825e2000001.570f7a1381e9a82659000001@mail.caseblocks.com"], "conversation_id"=>"570f77bc81e9a825e2000001"}
|
93
|
+
expect(@handler.fetch_metadata).to eq (expected_hash)
|
94
|
+
end
|
95
|
+
it "formats the metadata correctly" do
|
96
|
+
expected_hash = {"has_bounced"=>"", "in_reply_to"=>"", "message_id"=>"", "account_code"=>"", "references"=>[], "conversation_id"=>""}
|
97
|
+
expect(@handler.fetch_metadata).to match_keys_to (expected_hash)
|
98
|
+
end
|
99
|
+
it "includes metadata even if not available" do
|
100
|
+
handler = Mail2cb::EmailHandler.new(:inbound_message => @bare_bones, :mailbox => {:account_code => "test_account_code"})
|
101
|
+
expected_hash = {"has_bounced"=>nil, "in_reply_to"=>nil, "message_id"=>nil, "account_code"=>"test_account_code", "references"=>[]}
|
102
|
+
expect(handler.fetch_metadata).to match_keys_to (expected_hash)
|
103
|
+
expect(handler.fetch_metadata).to eq (expected_hash)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
describe "handles attachments" do
|
108
|
+
before(:each) do
|
109
|
+
@handler = Mail2cb::EmailHandler.new(:inbound_message => @multipart_related, :mailbox => {:account_code => "test_account_code"})
|
110
|
+
end
|
111
|
+
|
112
|
+
it "responses with an array of attachments" do
|
113
|
+
expect(@handler.generate_message_hash["attachments"]).to be_kind_of(Array)
|
114
|
+
end
|
115
|
+
|
116
|
+
context "s3" do
|
117
|
+
before(:each) do
|
118
|
+
ENV["AWS_ACCESS_KEY"] = "test-aws-access-key"
|
119
|
+
ENV["AWS_SECRET_KEY"] = "test-aws-secret-key"
|
120
|
+
ENV["AWS_MAILROOM_BUCKET"] = "a-test-bucket-on-s3"
|
121
|
+
|
122
|
+
@attachment = @handler.generate_message_hash["attachments"][0]
|
123
|
+
end
|
124
|
+
it "formats the hash correctly" do
|
125
|
+
expect(@attachment).to match_keys_to({"storage_type" => nil, "filename" => nil, "filepath" => nil, "url" => nil})
|
126
|
+
end
|
127
|
+
it "sets the type correctly" do
|
128
|
+
expect(@attachment["storage_type"]).to eq "S3"
|
129
|
+
end
|
130
|
+
it "constructs valid path to store attachments in" do
|
131
|
+
path = "/a-test-bucket-on-s3/attachments/test_account_code/ab7bec99ece9a5cbf49f40d57d681822"
|
132
|
+
expect(@attachment["filepath"].split("/")[0..-2].join("/")).to eq path
|
133
|
+
end
|
134
|
+
it "calls s3 store" do
|
135
|
+
expect(AWS::S3::S3Object).to receive(:store).once.with("/attachments/test_account_code/ab7bec99ece9a5cbf49f40d57d681822/D69E1746-1CEE-47FE-B7E2-8C64E6EC2C63.png", anything(), "a-test-bucket-on-s3")
|
136
|
+
@attachment = @handler.generate_message_hash["attachments"][0]
|
137
|
+
end
|
138
|
+
it "calls s3 url_for" do
|
139
|
+
expect(AWS::S3::S3Object).to receive(:url_for).once.with("/attachments/test_account_code/ab7bec99ece9a5cbf49f40d57d681822/D69E1746-1CEE-47FE-B7E2-8C64E6EC2C63.png", 'a-test-bucket-on-s3', {:expires_in => (60 * 60 * 24)})
|
140
|
+
@attachment = @handler.generate_message_hash["attachments"][0]
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
context "file" do
|
145
|
+
before(:each) do
|
146
|
+
@attachment = @handler.generate_message_hash["attachments"][0]
|
147
|
+
end
|
148
|
+
it "formats the hash correctly" do
|
149
|
+
expect(@attachment).to match_keys_to({"storage_type" => nil, "filename" => nil, "filepath" => nil})
|
150
|
+
end
|
151
|
+
it "sets the type correctly" do
|
152
|
+
expect(@attachment["storage_type"]).to eq "FILE"
|
153
|
+
end
|
154
|
+
it "constructs valid folder to store attachments in" do
|
155
|
+
path = @attachment["filepath"].split("/")[0..-2].join("/")
|
156
|
+
expect(File.directory?(path)).to be_truthy
|
157
|
+
end
|
158
|
+
it "saves the attachments to disk" do
|
159
|
+
expect(File.exists?(@attachment["filepath"])).to be_truthy
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
it "works out default format of mail with html" do
|
165
|
+
handler = Mail2cb::EmailHandler.new(:inbound_message => @simple, :mailbox => {:account_code => "test_account_code"})
|
166
|
+
expect(handler.content_type).to eq "text/html"
|
167
|
+
end
|
168
|
+
it "works out default format of mail with text only" do
|
169
|
+
handler = Mail2cb::EmailHandler.new(:inbound_message => @bare_bones, :mailbox => {:account_code => "test_account_code"})
|
170
|
+
expect(handler.content_type).to eq "text/plain"
|
171
|
+
end
|
172
|
+
it "calls sanitize with expected data" do
|
173
|
+
body = "<html><head></head><body><h1>Sample html content</h1></body></html>"
|
174
|
+
expect(Sanitize).to receive(:fragment).with(body, Sanitize::Config::RELAXED)
|
175
|
+
@handler.sanitize!
|
176
|
+
end
|
177
|
+
it "calls clean_replies with expected data" do
|
178
|
+
body = "<html><head></head><body><h1>Sample html content</h1></body></html>"
|
179
|
+
expect(Mail2cb::EmailBodyCleanser).to receive(:parse).with(body, "text/html")
|
180
|
+
@handler.clean_replies!
|
181
|
+
end
|
182
|
+
describe "queuing" do
|
183
|
+
it "queues the mail on the apppropriate redis key" do
|
184
|
+
$redis = double(:redis_client)
|
185
|
+
expect($redis).to receive(:lpush).with("cb:comms:test_account_code:inbox", anything())
|
186
|
+
|
187
|
+
@handler.queue!
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe Mail2cb::EmailHandler do
|
3
|
+
|
4
|
+
describe "without environment setup" do
|
5
|
+
it "should require REDIS_URL env variable" do
|
6
|
+
expect {Mail2cb::EmailWatcher.new}.to raise_error(RuntimeError, "REDIS_URL environment variable is required (eg redis://localhost:6739)")
|
7
|
+
end
|
8
|
+
it "should require MYSQL_HOST env variable" do
|
9
|
+
ENV["REDIS_URL"] = "x"
|
10
|
+
expect {Mail2cb::EmailWatcher.new}.to raise_error(RuntimeError, "MYSQL_HOST environment variable is required")
|
11
|
+
end
|
12
|
+
it "should require MYSQL_DATABASE env variable" do
|
13
|
+
ENV["REDIS_URL"] = "x"
|
14
|
+
ENV["MYSQL_HOST"] = "x"
|
15
|
+
expect {Mail2cb::EmailWatcher.new}.to raise_error(RuntimeError, "MYSQL_DATABASE environment variable is required")
|
16
|
+
end
|
17
|
+
it "should require MYSQL_USERNAME env variable" do
|
18
|
+
ENV["REDIS_URL"] = "x"
|
19
|
+
ENV["MYSQL_HOST"] = "x"
|
20
|
+
ENV["MYSQL_DATABASE"] = "x"
|
21
|
+
expect {Mail2cb::EmailWatcher.new}.to raise_error(RuntimeError, "MYSQL_USERNAME environment variable is required")
|
22
|
+
end
|
23
|
+
it "should require MYSQL_PASSWORD env variable" do
|
24
|
+
ENV["REDIS_URL"] = "x"
|
25
|
+
ENV["MYSQL_HOST"] = "x"
|
26
|
+
ENV["MYSQL_DATABASE"] = "x"
|
27
|
+
ENV["MYSQL_USERNAME"] = "x"
|
28
|
+
expect {Mail2cb::EmailWatcher.new}.to raise_error(RuntimeError, "MYSQL_PASSWORD environment variable is required")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "with environment setup" do
|
33
|
+
before(:each) do
|
34
|
+
setup_env
|
35
|
+
end
|
36
|
+
|
37
|
+
it "creates a new mailerdaemon"
|
38
|
+
it "starts the daemon"
|
39
|
+
it "extracts configuration from mysql"
|
40
|
+
it "formats mailbox hash correctly"
|
41
|
+
it "calls reload on mail daemon with updated configuration"
|
42
|
+
describe "on incoming messages" do
|
43
|
+
it "handles incoming messages with correct method"
|
44
|
+
it "calls email handler class"
|
45
|
+
it "calls sanitize"
|
46
|
+
it "calls clean_replies"
|
47
|
+
it "calls queue"
|
48
|
+
end
|
49
|
+
|
50
|
+
describe "message counts" do
|
51
|
+
it "increments message count on mailbox"
|
52
|
+
it "updates the last delivered at on mailbox"
|
53
|
+
context "with FAYE_HOST" do
|
54
|
+
it "publishes to faye"
|
55
|
+
end
|
56
|
+
context "without FAYE_HOST" do
|
57
|
+
it "does not publish to faye"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe Mail2cb::Encryption do
|
3
|
+
before(:each) do
|
4
|
+
ENV.delete("CASEBLOCKS_ENCRYPTION_KEY")
|
5
|
+
ENV.delete("CASEBLOCKS_ENCRYPTION_IV")
|
6
|
+
end
|
7
|
+
|
8
|
+
it "initializes with default encryption key and vector" do
|
9
|
+
enc = Mail2cb::Encryption.new
|
10
|
+
expect(enc.instance_variable_get(:@key)).to eq "YLX0IBT+OXaO4mP2bVYqzMPbrrss8eUcX1XtgLxlVH8="
|
11
|
+
expect(enc.instance_variable_get(:@iv)).to eq "vvSVfoWvZQ3T/DfjsjO/9w=="
|
12
|
+
end
|
13
|
+
it "initializes with custom encryption key and vector" do
|
14
|
+
ENV["CASEBLOCKS_ENCRYPTION_KEY"] = "abc"
|
15
|
+
ENV["CASEBLOCKS_ENCRYPTION_IV"] = "def"
|
16
|
+
enc = Mail2cb::Encryption.new
|
17
|
+
expect(enc.instance_variable_get(:@key)).to eq "abc"
|
18
|
+
expect(enc.instance_variable_get(:@iv)).to eq "def"
|
19
|
+
end
|
20
|
+
context "with same keys" do
|
21
|
+
before(:each) do
|
22
|
+
@enc = Mail2cb::Encryption.new
|
23
|
+
end
|
24
|
+
it "encrypts successfully" do
|
25
|
+
expect(@enc.encrypt("i am secret")).to eq "GljJGgTgiVhWM39qw+qHnw=="
|
26
|
+
end
|
27
|
+
it "decrypts successfully" do
|
28
|
+
expect(@enc.decrypt("GljJGgTgiVhWM39qw+qHnw==")).to eq "i am secret"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
context "without different keys" do
|
32
|
+
before(:each) do
|
33
|
+
@enc_valid = Mail2cb::Encryption.new
|
34
|
+
ENV["CASEBLOCKS_ENCRYPTION_KEY"] = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"
|
35
|
+
ENV["CASEBLOCKS_ENCRYPTION_IV"] = "abcdefghijklmnopqrstuvwxyz"
|
36
|
+
@enc_invalid = Mail2cb::Encryption.new
|
37
|
+
end
|
38
|
+
it "does not encrypt successfully" do
|
39
|
+
valid_encryption = @enc_valid.encrypt("i am another secret")
|
40
|
+
expect(@enc_invalid.encrypt("i am another secret")).to_not eq valid_encryption
|
41
|
+
end
|
42
|
+
it "does not decrypt successfully" do
|
43
|
+
valid_encryption = @enc_valid.encrypt("i am another secret")
|
44
|
+
expect{@enc_invalid.decrypt(valid_encryption)}.to raise_error(OpenSSL::Cipher::CipherError)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe Mail2cb::MessageIdHandler do
|
3
|
+
|
4
|
+
before(:each) do
|
5
|
+
@message_id_in_body = Mail.new(sample_mail("reply_message_id_in_body"))
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "email with message_id in body and references" do
|
9
|
+
it "instantiates with email param" do
|
10
|
+
expect(Mail2cb::MessageIdHandler.new(@message_id_in_body)).to be_instance_of Mail2cb::MessageIdHandler
|
11
|
+
end
|
12
|
+
|
13
|
+
it "gets message_id from headers" do
|
14
|
+
message_id = "conversation.570fb63381e9a82815000006.5714fa5b81e9a84fab000001@mail.caseblocks.com"
|
15
|
+
expect(Mail2cb::MessageIdHandler.new(@message_id_in_body).from_headers).to eq(message_id)
|
16
|
+
end
|
17
|
+
it "does not get message_id from subject" do
|
18
|
+
message_id = "conversation.570fb63381e9a82815000006.5714fa5b81e9a84fab000001@mail.caseblocks.com"
|
19
|
+
expect(Mail2cb::MessageIdHandler.new(@message_id_in_body).from_subject).to be_falsey
|
20
|
+
end
|
21
|
+
it "gets message_id from body" do
|
22
|
+
message_id = "conversation.570fb63381e9a82815000006.5714fa5b81e9a84fab000001@mail.caseblocks.com"
|
23
|
+
expect(Mail2cb::MessageIdHandler.new(@message_id_in_body).from_body).to eq(message_id)
|
24
|
+
end
|
25
|
+
it "returns correct message_id" do
|
26
|
+
message_id = "conversation.570fb63381e9a82815000006.5714fa5b81e9a84fab000001@mail.caseblocks.com"
|
27
|
+
expect(Mail2cb::MessageIdHandler.new(@message_id_in_body).message_id).to eq(message_id)
|
28
|
+
end
|
29
|
+
it "returns correct message_id_hash" do
|
30
|
+
message_id_hash = {"conversation_id" => '570fb63381e9a82815000006'}
|
31
|
+
expect(Mail2cb::MessageIdHandler.new(@message_id_in_body).hash).to eq(message_id_hash)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail2cb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- EmergeAdapt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,13 +53,13 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
type: :
|
62
|
+
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
@@ -67,7 +67,35 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: timecop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: mock-aws-s3
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: mysql2
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
101
|
- - ">="
|
@@ -100,16 +128,16 @@ dependencies:
|
|
100
128
|
requirements:
|
101
129
|
- - "~>"
|
102
130
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.0.
|
131
|
+
version: 0.0.8
|
104
132
|
type: :runtime
|
105
133
|
prerelease: false
|
106
134
|
version_requirements: !ruby/object:Gem::Requirement
|
107
135
|
requirements:
|
108
136
|
- - "~>"
|
109
137
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.0.
|
138
|
+
version: 0.0.8
|
111
139
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
140
|
+
name: nokogiri
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
114
142
|
requirements:
|
115
143
|
- - ">="
|
@@ -123,7 +151,7 @@ dependencies:
|
|
123
151
|
- !ruby/object:Gem::Version
|
124
152
|
version: '0'
|
125
153
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
154
|
+
name: sinatra
|
127
155
|
requirement: !ruby/object:Gem::Requirement
|
128
156
|
requirements:
|
129
157
|
- - ">="
|
@@ -137,7 +165,7 @@ dependencies:
|
|
137
165
|
- !ruby/object:Gem::Version
|
138
166
|
version: '0'
|
139
167
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
168
|
+
name: sanitize
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
142
170
|
requirements:
|
143
171
|
- - ">="
|
@@ -151,7 +179,7 @@ dependencies:
|
|
151
179
|
- !ruby/object:Gem::Version
|
152
180
|
version: '0'
|
153
181
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
182
|
+
name: faye
|
155
183
|
requirement: !ruby/object:Gem::Requirement
|
156
184
|
requirements:
|
157
185
|
- - ">="
|
@@ -164,30 +192,78 @@ dependencies:
|
|
164
192
|
- - ">="
|
165
193
|
- !ruby/object:Gem::Version
|
166
194
|
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: redis
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :runtime
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: aws-s3
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :runtime
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: rest-client
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - "~>"
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '1.8'
|
230
|
+
type: :runtime
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - "~>"
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '1.8'
|
167
237
|
description: Basic WIP.
|
168
238
|
email:
|
169
239
|
- development@emergeadapt.com
|
170
240
|
executables:
|
171
241
|
- mail2cb
|
242
|
+
- run
|
172
243
|
extensions: []
|
173
244
|
extra_rdoc_files: []
|
174
245
|
files:
|
175
246
|
- ".gitignore"
|
247
|
+
- ".rspec"
|
176
248
|
- ".ruby-gemset"
|
177
249
|
- ".ruby-version"
|
250
|
+
- Dockerfile
|
178
251
|
- Gemfile
|
179
252
|
- LICENSE
|
180
253
|
- LICENSE.txt
|
181
254
|
- README.md
|
182
255
|
- Rakefile
|
183
256
|
- bin/mail2cb
|
257
|
+
- bin/run
|
184
258
|
- config.yml
|
185
259
|
- lib/mail2cb.rb
|
186
|
-
- lib/mail2cb/
|
260
|
+
- lib/mail2cb/email_body_cleanser.rb
|
261
|
+
- lib/mail2cb/email_content.rb
|
187
262
|
- lib/mail2cb/email_handler.rb
|
188
263
|
- lib/mail2cb/email_watcher.rb
|
189
264
|
- lib/mail2cb/encryption.rb
|
190
265
|
- lib/mail2cb/helpers.rb
|
266
|
+
- lib/mail2cb/message_id_handler.rb
|
191
267
|
- lib/mail2cb/version.rb
|
192
268
|
- lib/public/custom.css
|
193
269
|
- lib/public/dashboard.css
|
@@ -195,6 +271,18 @@ files:
|
|
195
271
|
- lib/views/settings.erb
|
196
272
|
- lib/views/stats.erb
|
197
273
|
- mail2cb.gemspec
|
274
|
+
- samples/bare_bones.txt
|
275
|
+
- samples/reply.txt
|
276
|
+
- samples/reply_message_id_in_body.txt
|
277
|
+
- samples/reply_with_cc.txt
|
278
|
+
- spec/hash_key_matcher.rb
|
279
|
+
- spec/helpers.rb
|
280
|
+
- spec/mail2cb/email_content_spec.rb
|
281
|
+
- spec/mail2cb/email_handler_spec.rb
|
282
|
+
- spec/mail2cb/email_watcher_spec.rb
|
283
|
+
- spec/mail2cb/encryption_spec.rb
|
284
|
+
- spec/mail2cb/message_id_handler_spec.rb
|
285
|
+
- spec/spec_helper.rb
|
198
286
|
- test/lib/order2cb/order_test.rb
|
199
287
|
- test/lib/order2cb/version_test.rb
|
200
288
|
- test/lib/order2cb_test.rb
|
@@ -219,11 +307,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
307
|
version: '0'
|
220
308
|
requirements: []
|
221
309
|
rubyforge_project:
|
222
|
-
rubygems_version: 2.4.
|
310
|
+
rubygems_version: 2.4.8
|
223
311
|
signing_key:
|
224
312
|
specification_version: 4
|
225
313
|
summary: Grabs orders from Tyreshopper and posts them to SQS.
|
226
314
|
test_files:
|
315
|
+
- spec/hash_key_matcher.rb
|
316
|
+
- spec/helpers.rb
|
317
|
+
- spec/mail2cb/email_content_spec.rb
|
318
|
+
- spec/mail2cb/email_handler_spec.rb
|
319
|
+
- spec/mail2cb/email_watcher_spec.rb
|
320
|
+
- spec/mail2cb/encryption_spec.rb
|
321
|
+
- spec/mail2cb/message_id_handler_spec.rb
|
322
|
+
- spec/spec_helper.rb
|
227
323
|
- test/lib/order2cb/order_test.rb
|
228
324
|
- test/lib/order2cb/version_test.rb
|
229
325
|
- test/lib/order2cb_test.rb
|