gitlab-mail_room 0.0.21 → 0.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +2 -1
- data/lib/mail_room/delivery/que.rb +15 -1
- data/lib/mail_room/version.rb +1 -1
- data/mail_room.gemspec +1 -4
- metadata +5 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b83e39da2869147d1086529b11cfb371446aa616323dbc5c5212330d12f8fe9f
|
4
|
+
data.tar.gz: 96840ed2fb7347df81ba7c139f02d0613b0041979b28a9ae52c5879452898133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aff0a7be49b42b0d645414385988805d9fc283528876c7605b90c6535a364b40c09b2e2ca8909413238bc20e4a01e55b730c7361cee6db537a72fa60f38f422
|
7
|
+
data.tar.gz: dc9bf6c5edd55071cc512a30fc56981a50119d2f3dc0a02d18a7dfed5ac90160a7500404418ec80ddcc39db3947a091ede405132453312a145ac8886ce8d543a
|
data/.gitlab-ci.yml
CHANGED
@@ -6,6 +6,7 @@ services:
|
|
6
6
|
|
7
7
|
.test-template: &test
|
8
8
|
cache:
|
9
|
+
key: ruby-$RUBY_VERSION
|
9
10
|
paths:
|
10
11
|
- vendor/ruby
|
11
12
|
variables:
|
@@ -22,7 +23,7 @@ services:
|
|
22
23
|
rspec:
|
23
24
|
parallel:
|
24
25
|
matrix:
|
25
|
-
- RUBY_VERSION: [ "2.
|
26
|
+
- RUBY_VERSION: [ "2.6", "2.7", "3.0", "3.1", "3.2" ]
|
26
27
|
<<: *test
|
27
28
|
|
28
29
|
include:
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'pg'
|
2
2
|
require 'json'
|
3
|
+
require 'charlock_holmes'
|
3
4
|
|
4
5
|
module MailRoom
|
5
6
|
module Delivery
|
@@ -34,7 +35,7 @@ module MailRoom
|
|
34
35
|
# deliver the message by pushing it onto the configured Sidekiq queue
|
35
36
|
# @param message [String] the email message as a string, RFC822 format
|
36
37
|
def deliver(message)
|
37
|
-
queue_job(message)
|
38
|
+
queue_job(utf8_encode_message(message))
|
38
39
|
@options.logger.info({ delivery_method: 'Que', action: 'message pushed' })
|
39
40
|
end
|
40
41
|
|
@@ -58,6 +59,19 @@ module MailRoom
|
|
58
59
|
|
59
60
|
connection.exec(sql, [options.priority, options.job_class, options.queue, JSON.dump(args)])
|
60
61
|
end
|
62
|
+
|
63
|
+
def utf8_encode_message(message)
|
64
|
+
message = message.dup
|
65
|
+
|
66
|
+
message.force_encoding("UTF-8")
|
67
|
+
return message if message.valid_encoding?
|
68
|
+
|
69
|
+
detection = CharlockHolmes::EncodingDetector.detect(message)
|
70
|
+
return message unless detection && detection[:encoding]
|
71
|
+
|
72
|
+
# Convert non-UTF-8 body UTF-8 so it can be dumped as JSON.
|
73
|
+
CharlockHolmes::Converter.convert(message, detection[:encoding], 'UTF-8')
|
74
|
+
end
|
61
75
|
end
|
62
76
|
end
|
63
77
|
end
|
data/lib/mail_room/version.rb
CHANGED
data/mail_room.gemspec
CHANGED
@@ -18,12 +18,9 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
20
|
gem.add_dependency "net-imap", ">= 0.2.1"
|
21
|
-
gem.add_dependency "oauth2",
|
21
|
+
gem.add_dependency "oauth2", "~> 1.4.4"
|
22
22
|
gem.add_dependency "jwt", ">= 2.0"
|
23
23
|
|
24
|
-
# Pinning io-wait to 0.1.0, which is the last version to support Ruby < 3
|
25
|
-
gem.add_dependency "io-wait", "~> 0.1.0"
|
26
|
-
|
27
24
|
gem.add_development_dependency "rake"
|
28
25
|
gem.add_development_dependency "rspec", "~> 3.9"
|
29
26
|
gem.add_development_dependency "rubocop", "~> 1.11"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-mail_room
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Pitale
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-imap
|
@@ -28,22 +28,16 @@ dependencies:
|
|
28
28
|
name: oauth2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.4.4
|
34
|
-
- - "<"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: '3'
|
37
34
|
type: :runtime
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
40
37
|
requirements:
|
41
|
-
- - "
|
38
|
+
- - "~>"
|
42
39
|
- !ruby/object:Gem::Version
|
43
40
|
version: 1.4.4
|
44
|
-
- - "<"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '3'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: jwt
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,20 +52,6 @@ dependencies:
|
|
58
52
|
- - ">="
|
59
53
|
- !ruby/object:Gem::Version
|
60
54
|
version: '2.0'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: io-wait
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: 0.1.0
|
68
|
-
type: :runtime
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 0.1.0
|
75
55
|
- !ruby/object:Gem::Dependency
|
76
56
|
name: rake
|
77
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -362,7 +342,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
362
342
|
- !ruby/object:Gem::Version
|
363
343
|
version: '0'
|
364
344
|
requirements: []
|
365
|
-
rubygems_version: 3.
|
345
|
+
rubygems_version: 3.4.7
|
366
346
|
signing_key:
|
367
347
|
specification_version: 4
|
368
348
|
summary: mail_room will proxy email (gmail) from IMAP to a callback URL, logger, or
|