zimbra_intercepting_proxy 0.0.3 → 0.0.4

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: 7c7f7046776cf205245cbde70267e206643986c1
4
- data.tar.gz: c9ae7ef1a7cc0ffd0b0661e126314c499ea6b1ad
3
+ metadata.gz: 13014cbc0b2f8729c3079254f548839e8b428c59
4
+ data.tar.gz: 98d5d9e8bba077cda0e506f0247ba78b6443dd18
5
5
  SHA512:
6
- metadata.gz: ed30ee78039163bc5b67b980a80c5106c9f562e7c3a5d6a2fcae0c187a08eca4510044c57210ef7eeed1b6f9a4804d3782835ad86b004f61684e878d4c979c26
7
- data.tar.gz: 3e88d63c9fb9fd0165e29276e75c3d81576f86d33205c76713d4b72ae3ce099dc9a039c49c3ae3b36fab3cf890ea36a8fc9b495900c82bb08bde6501e814b5f1
6
+ metadata.gz: 922b9a8f8e97c8b1c3c2f8bb603583db06d2327356bf7bc5e63c0f9dd737f838de0f4b3dfa2cf8ad00bd35e8aa41bfab29c44ca61da0dd0ad290e5bdacd51dd6
7
+ data.tar.gz: 0812af25372e6c557b8e1c36d83f119fbf5df04866613929a397149e26c20d7bf1c8d72f0d110694f8477f1d7891d1a87154d529b012e951adf12f25b372600e
@@ -38,7 +38,7 @@ optparse = OptionParser.new do |opts|
38
38
  end
39
39
 
40
40
  opts.on("-nmbxipADDRESS", "--newmailboxlocalip=ADDRESS", "The internal IP Address of the new backend mailbox") do |o|
41
- options[:new_mbx_local_ip] = o
41
+ options[:new_mbx_local_ip_regex] = o
42
42
  end
43
43
 
44
44
  opts.on("-v", "--verbose", "Save logs information to /var/log/zimbra_intercepting_proxy.log") do |o|
@@ -70,12 +70,12 @@ module ZimbraInterceptingProxy
70
70
  @debug
71
71
  end
72
72
 
73
- def self.new_mbx_local_ip=(ip)
74
- @new_mbx_local_ip = ip
73
+ def self.new_mbx_local_ip_regex=(ip)
74
+ @new_mbx_local_ip_regex = ip
75
75
  end
76
76
 
77
- def self.new_mbx_local_ip
78
- @new_mbx_local_ip
77
+ def self.new_mbx_local_ip_regex
78
+ @new_mbx_local_ip_regex
79
79
  end
80
80
 
81
81
  end
@@ -7,7 +7,7 @@ module ZimbraInterceptingProxy
7
7
  debug = ZimbraInterceptingProxy::Debug
8
8
  host = ZimbraInterceptingProxy::Config.bind_address
9
9
  port = ZimbraInterceptingProxy::Config.bind_port
10
- new_mbx_local_ip = ZimbraInterceptingProxy::Config.new_mbx_local_ip
10
+ new_mbx_local_ip_regex = ZimbraInterceptingProxy::Config.new_mbx_local_ip_regex
11
11
 
12
12
  Proxy.start(:host => host, :port => port) do |conn|
13
13
 
@@ -50,7 +50,7 @@ module ZimbraInterceptingProxy
50
50
  end
51
51
 
52
52
  conn.on_response do |backend, resp|
53
- regex = Regexp.new "Auth-Server: #{new_mbx_local_ip}"
53
+ regex = Regexp.new "Auth-Server: #{new_mbx_local_ip_regex}*"
54
54
  new_resp = resp.gsub(regex, "Auth-Server: #{ZimbraInterceptingProxy::Config.new_backend}")
55
55
  debug.logger [:on_response, backend, new_resp]
56
56
  new_resp
@@ -1,3 +1,3 @@
1
1
  module ZimbraInterceptingProxy
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -28,6 +28,7 @@ module ZimbraInterceptingProxy
28
28
  ZimbraInterceptingProxy::Config.bind_address = options[:bind_address] || "0.0.0.0"
29
29
  ZimbraInterceptingProxy::Config.bind_port = options[:bind_port]
30
30
  ZimbraInterceptingProxy::Config.debug = options[:debug]
31
+ ZimbraInterceptingProxy::Config.new_mbx_local_ip_regex = options[:new_mbx_local_ip_regex]
31
32
  end
32
33
 
33
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zimbra_intercepting_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patricio Bruna