zimbra_intercepting_proxy 0.0.3 → 0.0.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13014cbc0b2f8729c3079254f548839e8b428c59
|
4
|
+
data.tar.gz: 98d5d9e8bba077cda0e506f0247ba78b6443dd18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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[:
|
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.
|
74
|
-
@
|
73
|
+
def self.new_mbx_local_ip_regex=(ip)
|
74
|
+
@new_mbx_local_ip_regex = ip
|
75
75
|
end
|
76
76
|
|
77
|
-
def self.
|
78
|
-
@
|
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
|
-
|
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: #{
|
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
|
@@ -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
|