Codebase list ruby-mail-room / 2461ab6
New upstream version 0.10.0+really0.0.7 Pirate Praveen 3 years ago
3 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
4848 idle
4949
5050 process_mailbox
51 rescue Net::IMAP::Error, IOError
52 @mailbox.logger.warn({ context: @mailbox.context, action: "Disconnected. Resetting..." })
51 rescue Net::IMAP::Error, IOError => e
52 @mailbox.logger.warn({ context: @mailbox.context, action: "Disconnected. Resetting...", error: e.message })
5353 reset
5454 setup
5555 end
175175 # uid_search still leaves messages UNSEEN
176176 all_unread = imap.uid_search(@mailbox.search_command)
177177
178 all_unread = all_unread.slice(0, @mailbox.limit_max_unread) unless @mailbox.limit_max_unread.nil? || @mailbox.limit_max_unread == 0
179
178180 to_deliver = all_unread.select { |uid| @mailbox.deliver?(uid) }
179 @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 } })
181 @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 } })
180182 to_deliver
181183 end
182184
99 :port,
1010 :ssl,
1111 :start_tls,
12 :limit_max_unread, #to avoid 'Error in IMAP command UID FETCH: Too long argument'
1213 :idle_timeout,
1314 :search_command,
1415 :name,
4950 :port => 993,
5051 :ssl => true,
5152 :start_tls => false,
53 :limit_max_unread => 0,
5254 :idle_timeout => IMAP_IDLE_TIMEOUT,
5355 :delete_after_delivery => false,
5456 :expunge_deleted => false,
00 module MailRoom
11 # Current version of gitlab-mail_room gem
2 VERSION = "0.0.6"
2 VERSION = "0.0.7"
33 end