mail2cb 0.0.10 → 0.0.13

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: b543b885ac95a03294916bf21153e2e24c10f03e
4
- data.tar.gz: cf6c04c3f0d66a1b101d24fad3805600386304a1
3
+ metadata.gz: 7d2cba71197126aa98852f1e336207c4135ffb5e
4
+ data.tar.gz: ea8bc136dd810fcf720091dfc05ed0ea0118a72f
5
5
  SHA512:
6
- metadata.gz: 9b4cf23a8af24d680583c029ac6c3012bd12ab7bbef1173aa542a5c03a55dcca8cde5df2a77f579d5f164cb9029486260826296ba0fe2867c00db355684820b1
7
- data.tar.gz: afae4ac1dc2e2611bbd262892260b20f1958f87fbb2218d0bfc9eb471e3d78311e1a9fbdfea372800ca58a60af33ece2baa3a7608e925d40a4a1c86de7b30d1d
6
+ metadata.gz: 401608a23939fb8fda0fade16549d771e170502a61873e213fb9d737030a0b822f1bb414e1f7acd8463854db134ffae995cfe0feea64bff84d9ac1d30a22d38c
7
+ data.tar.gz: 1fc92b60cc5a1057670c73cbc5e56cd58869e295154113fe5da545365aebdac7fb024b349a9b161d7571d66de307f9006649fee33812b03c9fba134e7999f1ac
data/Dockerfile CHANGED
@@ -34,4 +34,4 @@ RUN cd /var/www/mail2cb
34
34
  RUN bundle install
35
35
 
36
36
  EXPOSE 8016
37
- CMD bin/run
37
+ CMD bin/mail2cb
data/bin/mail2cb CHANGED
@@ -30,6 +30,8 @@ puts "Connecting to Redis: #{ENV["REDIS_URL"]}"
30
30
  ENV["FAYE_HOST"] = "http://localhost"
31
31
  ENV["FAYE_PORT"] = "9292"
32
32
 
33
+ ENV["CRYPT_API_ENDPOINT"] = "http://localhost:8888/case_blocks/crypt" if ENV["CRYPT_API_ENDPOINT"].nil?
34
+
33
35
  ENV["DEBUG"] = "false"
34
36
 
35
37
  oh = Mail2cb::Handler.new
data/lib/mail2cb.rb CHANGED
@@ -23,6 +23,7 @@ module Mail2cb
23
23
  my_app = Sinatra.new do
24
24
  set :logging, false
25
25
  set :run, false
26
+ set :bind, '0.0.0.0'
26
27
 
27
28
  get('/reload') do
28
29
  @@watcher.restart
@@ -58,6 +58,9 @@ module Mail2cb
58
58
  "in_reply_to" => @email.in_reply_to,
59
59
  "message_id" => @email.message_id,
60
60
  "account_code" => @options[:mailbox][:account_code],
61
+ "mailbox_id" => @options[:mailbox][:mailbox_id],
62
+ "mailbox_name" => @options[:mailbox][:mailbox_name],
63
+ "mailbox_default" => @options[:mailbox][:mailbox_default],
61
64
  "references" => id_parser.references
62
65
  }.merge(id_parser.hash)
63
66
  end
@@ -69,7 +69,9 @@ module Mail2cb
69
69
  case_blocks_email_accounts.imap_search_command,
70
70
  case_blocks_email_accounts.imap_messages_processed,
71
71
  case_blocks_email_accounts.imap_last_processed_at,
72
- u.authentication_token
72
+ u.authentication_token,
73
+ case_blocks_email_accounts.id as mailbox_id,
74
+ case_blocks_email_accounts.name as mailbox_name
73
75
  FROM case_blocks_email_accounts
74
76
  JOIN case_blocks_accounts
75
77
  ON case_blocks_email_accounts.account_id = case_blocks_accounts.id
@@ -87,7 +89,23 @@ EOS
87
89
  auth_token = row["authentication_token"]
88
90
  decrypted_password = Encryption.new(auth_token).decrypt(row["imap_encrypted_password"])
89
91
  puts "decrypted password: #{decrypted_password}"
90
- mailboxes << {:id => row["id"], :account_code => row["nickname"], :account_id => row["account_id"], :username => row["imap_username"], :host => row["imap_host"], :port => row["imap_port"], :password => decrypted_password, :ssl_options => ssl_options, :start_tls => row["imap_start_tls"]==1, :name => row["imap_folder_nam"], :search_command => row["imap_search_command"], :message_count => row["imap_messages_processed"], :last_delivered_at => row["imap_last_processed_at"]}
92
+ mailboxes << {:id => row["id"],
93
+ :account_code => row["nickname"],
94
+ :account_id => row["account_id"],
95
+ :username => row["imap_username"],
96
+ :host => row["imap_host"],
97
+ :port => row["imap_port"],
98
+ :password => decrypted_password,
99
+ :ssl_options => ssl_options,
100
+ :start_tls => row["imap_start_tls"]==1,
101
+ :name => row["imap_folder_nam"],
102
+ :search_command => row["imap_search_command"],
103
+ :message_count => row["imap_messages_processed"],
104
+ :last_delivered_at => row["imap_last_processed_at"],
105
+ :mailbox_id => row["mailbox_id"],
106
+ :mailbox_name => row["mailbox_name"],
107
+ :mailbox_default => row['smtp_is_default']==1
108
+ }
91
109
  end
92
110
  end
93
111
  mailboxes
@@ -1,3 +1,3 @@
1
1
  module Mail2cb
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.13"
3
3
  end
data/mail2cb.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_dependency 'mysql2'
31
31
  spec.add_dependency 'mail'
32
- spec.add_dependency 'mail_daemon', "~> 0.0.8"
32
+ spec.add_dependency 'mail_daemon', "~> 0.0.10"
33
33
  spec.add_dependency 'nokogiri'
34
34
  spec.add_dependency 'sinatra'
35
35
  spec.add_dependency 'sanitize'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail2cb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - EmergeAdapt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-04 00:00:00.000000000 Z
11
+ date: 2016-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.0.8
131
+ version: 0.0.10
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.0.8
138
+ version: 0.0.10
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: nokogiri
141
141
  requirement: !ruby/object:Gem::Requirement