mail_daemon 0.0.15 → 0.1.0
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 +4 -4
- data/lib/mail_daemon.rb +1 -1
- data/lib/mail_daemon/imap/connection.rb +3 -1
- data/lib/mail_daemon/imap_watcher.rb +1 -1
- data/lib/mail_daemon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5226d2c3534a01d2ef7b66564b4a1bc8db68d19a
|
|
4
|
+
data.tar.gz: 74956f445f5f5a4d52d5ae89fa59a2b5a0543ff1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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(
|
|
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,
|
|
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}"
|
data/lib/mail_daemon/version.rb
CHANGED
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
|
|
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-
|
|
11
|
+
date: 2018-06-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|