gitlab-mail_room 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ccfebf927b528ccf65a3c9abefe2bc01af5b65797cf37e8f8ac969e2ffb8542
4
- data.tar.gz: e95297059e57bafea5ddb2a11a0d1394b2b7480c71cbef995644023a98b6fd18
3
+ metadata.gz: e292b944039730eb7a2e51d8f878aba00921a827e11af32a17d1c1bb68e460ed
4
+ data.tar.gz: aec54302a613d21a4156bfadcd81beae514a08e8ab137177af8d86cf60e191e3
5
5
  SHA512:
6
- metadata.gz: 934aa18912e38b2128a8409998610869441964d80c898b0f97de6e6abef96b9b8169640bb139fdfdaaa2b0f4ce8b05cd97f904b7be9355b7e68dea0d5fc3b928
7
- data.tar.gz: 5ddae279a3821c965921e23694a5cf5a880f46ee1ba6b56aa7f6bf3b2b1c38df4e19df3a555382a52b2da127d16d0646f641bbe8f587a45c7612649f5f7a1988
6
+ metadata.gz: c417220205744707fbe7c8b2bcb837abb1f7fbc07e5ec13fe04656d101f5eb0dbb80146fd5cfa1bbfe936c9dc2b8a4c331de5718ea8a4f0c2505173903713533
7
+ data.tar.gz: 7171e962dbf1e20e574bfbb26ad803ffa8dbfaecda7831c3a1f22faa11e9fe33ab093ae48a72ace3342e8bfe833010e3d15b700b869f0e369b6929865a0cd40d
@@ -49,8 +49,8 @@ module MailRoom
49
49
  idle
50
50
 
51
51
  process_mailbox
52
- rescue Net::IMAP::Error, IOError
53
- @mailbox.logger.warn({ context: @mailbox.context, action: "Disconnected. Resetting..." })
52
+ rescue Net::IMAP::Error, IOError => e
53
+ @mailbox.logger.warn({ context: @mailbox.context, action: "Disconnected. Resetting...", error: e.message })
54
54
  reset
55
55
  setup
56
56
  end
@@ -176,8 +176,10 @@ module MailRoom
176
176
  # uid_search still leaves messages UNSEEN
177
177
  all_unread = imap.uid_search(@mailbox.search_command)
178
178
 
179
+ all_unread = all_unread.slice(0, @mailbox.limit_max_unread) unless @mailbox.limit_max_unread.nil? || @mailbox.limit_max_unread == 0
180
+
179
181
  to_deliver = all_unread.select { |uid| @mailbox.deliver?(uid) }
180
- @mailbox.logger.info({ context: @mailbox.context, action: "Getting new messages", unread: {count: all_unread.count, ids: all_unread}, to_be_delivered: { count: to_deliver.count, ids: all_unread } })
182
+ @mailbox.logger.info({ context: @mailbox.context, action: "Getting new messages", unread: {count: all_unread.count, ids: all_unread}, to_be_delivered: { count: to_deliver.count, ids: to_deliver } })
181
183
  to_deliver
182
184
  end
183
185
 
@@ -10,6 +10,7 @@ module MailRoom
10
10
  :port,
11
11
  :ssl,
12
12
  :start_tls,
13
+ :limit_max_unread, #to avoid 'Error in IMAP command UID FETCH: Too long argument'
13
14
  :idle_timeout,
14
15
  :search_command,
15
16
  :name,
@@ -50,6 +51,7 @@ module MailRoom
50
51
  :port => 993,
51
52
  :ssl => true,
52
53
  :start_tls => false,
54
+ :limit_max_unread => 0,
53
55
  :idle_timeout => IMAP_IDLE_TIMEOUT,
54
56
  :delete_after_delivery => false,
55
57
  :expunge_deleted => false,
@@ -1,4 +1,4 @@
1
1
  module MailRoom
2
2
  # Current version of gitlab-mail_room gem
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Pitale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-17 00:00:00.000000000 Z
11
+ date: 2020-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
240
  - !ruby/object:Gem::Version
241
241
  version: '0'
242
242
  requirements: []
243
- rubygems_version: 3.1.2
243
+ rubygems_version: 3.0.1
244
244
  signing_key:
245
245
  specification_version: 4
246
246
  summary: mail_room will proxy email (gmail) from IMAP to a callback URL, logger, or