mail_daemon 0.0.15 → 0.1.0

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
  SHA1:
3
- metadata.gz: e4359f022c6ceae588ca63c6ce25580d5989a40b
4
- data.tar.gz: d750731afde3a6fefc52517724a199e0c78a338d
3
+ metadata.gz: 5226d2c3534a01d2ef7b66564b4a1bc8db68d19a
4
+ data.tar.gz: 74956f445f5f5a4d52d5ae89fa59a2b5a0543ff1
5
5
  SHA512:
6
- metadata.gz: 8cd2ce921482159cdc350c559af5e5291f0f856d6b9ef7adcab0d8eb4614af8ccb70210a2a5f50eaf6d6f70d57ce1976e571fb9e5bd02bd81d5d60c00bfc0be9
7
- data.tar.gz: ca643bd953856b41407ad048267d57a81b58f1efa638c6f5da4b210424351a79818377e939b82b3a39938f09db74c050839e682cf2d07ac59a253206ec66d287
6
+ metadata.gz: 8fa545caacb5e754db330cdf1f666cfeae9441a1d82028130a6d3aa1ab9c3f0546b4a35ac286ea5c6de3b95740db865aa695f9282c242b7682a5418f839cf44d
7
+ data.tar.gz: 3bb1108f8e0297693c1c53cdf407ff13eb9e255cded8dfe89b5d6ae1e9c0e5cccbde0d798d182af92a9721f9f9962dd251093e2d260a26a43cfbd5dbf300f6de
data/lib/mail_daemon.rb CHANGED
@@ -63,7 +63,7 @@ module MailDaemon
63
63
  mailbox[:ssl_options] = {:verify_mode => OpenSSL::SSL::VERIFY_NONE} if mailbox[:ssl]
64
64
 
65
65
  puts "Setting up watcher for #{mailbox[:username]}" if @options[:debug]
66
- @watchers << MailDaemon::Imap::Watcher.new(mailbox.merge(:debug => @options[:debug]))
66
+ @watchers << MailDaemon::Imap::Watcher.new(@options.merge(mailbox))
67
67
  end
68
68
  @threads = []
69
69
  @watchers.each do |watcher|
@@ -11,6 +11,7 @@ module MailDaemon
11
11
  def initialize(options, &block)
12
12
  setup_options(options)
13
13
 
14
+
14
15
  required_option [:host, :username, :password]
15
16
 
16
17
  default_option :port, 143
@@ -18,10 +19,11 @@ module MailDaemon
18
19
  default_option :ssl, false
19
20
  default_option :start_tls, false
20
21
  default_option :ssl_options, false
21
- default_option :sleep_time, 10000
22
+ default_option :sleep_time, 30
22
23
  default_option :imap_timeout, 60
23
24
  default_option :idle_recycle_time, 29 * SECONDS_IN_MINUTES
24
25
 
26
+
25
27
  @notify_status_block = block
26
28
 
27
29
  puts "initializing new imap connection for #{@options[:username]}:#{@options[:password]}@#{@options[:host]}:#{@options[:port]} " if @options[:debug]
@@ -42,7 +42,7 @@ module MailDaemon
42
42
  ssl = row["imap_ssl"]==1 ? {:verify_mode => "none"} : false
43
43
  decrypted_password = Encryption.new.decrypt(row["imap_encrypted_password"])
44
44
  begin
45
- watcher = Imap::Connection.new({:email => row["imap_username"], :host => row["imap_host"], :port => row["imap_port"], :password => decrypted_password, :ssl => ssl, :start_tls => row["imap_start_tls"]==1, :name => row["imap_folder_name"], :search_command => row["imap_search_command"], :message_count => row["imap_messages_processed"], :last_delivered_at => row["imap_last_delivered_at"], :delivery_method=>"sidekiq", :delivery_options=>{:redis_url => ENV["REDIS_URL"], :queue => "email_handler", :worker=>"EmailHandlerWorker"}})
45
+ watcher = Imap::Connection.new(@options.merge({:email => row["imap_username"], :host => row["imap_host"], :port => row["imap_port"], :password => decrypted_password, :ssl => ssl, :start_tls => row["imap_start_tls"]==1, :name => row["imap_folder_name"], :search_command => row["imap_search_command"], :message_count => row["imap_messages_processed"], :last_delivered_at => row["imap_last_delivered_at"], :delivery_method=>"sidekiq", :delivery_options=>{:redis_url => ENV["REDIS_URL"], :queue => "email_handler", :worker=>"EmailHandlerWorker"}}))
46
46
  watchers << watcher
47
47
  rescue => e
48
48
  puts "Unable to create IMAP4 connection for #{row['nickname']}/#{row['name']}. #{e.message}"
@@ -1,3 +1,3 @@
1
1
  module MailDaemon
2
- VERSION = "0.0.15"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail_daemon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - EmergeAdapt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-19 00:00:00.000000000 Z
11
+ date: 2018-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler