gitlab-mail_room 0.0.21 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5eee8d42a23b577564cf4f77e6601c8a8711f1a65477dacebf3e4d7055ceb916
4
- data.tar.gz: d30ffb51bc19e4ee57b6e62f5095241690230492fd95d45345faed9ed9cb6949
3
+ metadata.gz: 1fa8e5569da85c3fa57acd7d2729af8f67429f281f13cc87fdbfdd8d533f3ee9
4
+ data.tar.gz: 50d4dccc94549ff477922d7318115e1992a87566e6d159d50f046015cf875e10
5
5
  SHA512:
6
- metadata.gz: 865f72774e011d86267bb45c0b0509c5b81734516dad6ee63bfa51b4d377800a139bfc8c2cca1d559471b4342f144f3ffa63be99cf6a25d1ca320a11bbd1d7fe
7
- data.tar.gz: 7cb2bb12298f3394062890eb59ccfc6d1fc1e08394bbc60887e554b2076044af96a637ee004b596753f62feee4f3439e162342c5502f7c66a6fb089af587c0fc
6
+ metadata.gz: 2e4d8fe88a968459036de06624cd917b3e68a6f4bf5a5cd1bcbb9e0d466dcff8608cead170a8e813f45bcccc2b5c342d603732b9520314d8792c23e4523d91ff
7
+ data.tar.gz: 5de2450bbd78041a19c4996ebaa74b2497af0e7362c4e6e5338ccc10a740bc4cc13a508bd3cc7cea55a7eabd7da25365b544d7baa0e33dd134c40b0bd1a0f577
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.5", "2.6", "2.7", "3.0" ]
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
@@ -1,4 +1,4 @@
1
1
  module MailRoom
2
2
  # Current version of gitlab-mail_room gem
3
- VERSION = "0.0.21"
3
+ VERSION = "0.0.23"
4
4
  end
data/mail_room.gemspec CHANGED
@@ -21,9 +21,6 @@ Gem::Specification.new do |gem|
21
21
  gem.add_dependency "oauth2", [">= 1.4.4", "< 3"]
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.21
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Pitale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-23 00:00:00.000000000 Z
11
+ date: 2023-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-imap
@@ -58,20 +58,6 @@ dependencies:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  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
61
  - !ruby/object:Gem::Dependency
76
62
  name: rake
77
63
  requirement: !ruby/object:Gem::Requirement
@@ -362,7 +348,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
362
348
  - !ruby/object:Gem::Version
363
349
  version: '0'
364
350
  requirements: []
365
- rubygems_version: 3.2.22
351
+ rubygems_version: 3.4.7
366
352
  signing_key:
367
353
  specification_version: 4
368
354
  summary: mail_room will proxy email (gmail) from IMAP to a callback URL, logger, or