zimbra_intercepting_proxy 0.0.4.2 → 0.0.4.3
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/README.md +124 -23
- data/lib/zimbra_intercepting_proxy/server.rb +8 -2
- data/lib/zimbra_intercepting_proxy/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: 83d9620bd1aa1ec6ac96f2aa64db725be374daae
|
4
|
+
data.tar.gz: 7071c9856422b7ab43172b76c156a4c69ba38f9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2fce49c23f5a8a3886e390093e56ff6d3dc7e9ad169c75d2d6204975b2d3af39c83d489d8cc7db60826bb5ae6a991f546bc23cf340fa03d5b44e40d69b3c36b
|
7
|
+
data.tar.gz: 63722a2fecf679f020c42afd7c63ee02988993627a38c8c223921c10f7c874c6a96e2cdc46ef36d0fd3440fd5149ef9612b707abf19ad3f8c55782d5336688c2
|
data/README.md
CHANGED
@@ -1,47 +1,148 @@
|
|
1
|
-
#
|
1
|
+
# Zimbra Intercepting Proxy
|
2
2
|
|
3
|
-
This software is used to
|
4
|
-
If you don't know what Zimbra Proxy is, You can read about it here: [https://wiki.zimbra.com/wiki/Zimbra_Proxy_Guide](https://wiki.zimbra.com/wiki/Zimbra_Proxy_Guide)
|
3
|
+
This software is used to intercept and apply modifications to the traffic between a Zimbra Proxy and Zimbra Mailboxes.
|
4
|
+
If you don't know what a Zimbra Proxy is, You can read about it here: [https://wiki.zimbra.com/wiki/Zimbra_Proxy_Guide](https://wiki.zimbra.com/wiki/Zimbra_Proxy_Guide)
|
5
5
|
|
6
|
-
|
6
|
+
This work for all kind of client access:
|
7
|
+
|
8
|
+
* POP3
|
9
|
+
* IMAP
|
10
|
+
* Webmail
|
11
|
+
* ActiveSync
|
12
|
+
* Zimbra Outlook Connector
|
13
|
+
|
14
|
+
## What this try to solve?
|
7
15
|
|
8
16
|
### Zimbra Migrations
|
9
|
-
Suppose you
|
17
|
+
Suppose you need to move a lot of users and data from one Zimbra Platform to another, like we do at [ZBox](http://www.zboxapp.com), and given the size of the migration, you can't move all the mailboxes at once, so you have to do it in groups.
|
18
|
+
|
19
|
+
This procedure have the following inconvenients:
|
20
|
+
|
21
|
+
* You have to update the configuration of the clients for all the migrated users,
|
22
|
+
* Your users will need to learn a new Webmail URL,
|
23
|
+
* It's not transparent for the end user,
|
24
|
+
* It's a lot of work for you
|
25
|
+
|
26
|
+
### Network and OpenSource Deployments
|
27
|
+
Not a hot topic for Zimbra Inc., sorry guys, but lets be honest about it, some companies can't afford Zimbra Network for all the employees, so they use two setup platform.
|
28
|
+
|
29
|
+
The main problem with this is that you have to configure your clients with to kind of information.
|
30
|
+
|
31
|
+
### How Zimbra Intercepting Proxy Works
|
32
|
+
Zimbra Intercepting Proxy reads a map file, a `YAML` file, in which you indicate the pair `username:zimbraID` of the users located on the _other_ Mailbox.
|
33
|
+
|
34
|
+
Based on this information, `ZIP` tell the Zimbra Proxy to which Mailbox it should communicate with.
|
35
|
+
|
36
|
+
## Instalation and configuration
|
37
|
+
|
38
|
+
### Requirements
|
39
|
+
This has been tested with:
|
40
|
+
|
41
|
+
* Zimbra >= 7
|
42
|
+
* Ruby >= 2.0
|
43
|
+
* Zimbra Proxy
|
44
|
+
|
45
|
+
**You need to have direct access to the `7072` port of both Mailboxes**.
|
46
|
+
|
47
|
+
### Installation
|
48
|
+
It's recommended to install it on the same Zimbra Proxy server. All you need to do is run:
|
49
|
+
|
50
|
+
```bash
|
51
|
+
$ gem install zimbra_intercepting_proxy
|
52
|
+
```
|
53
|
+
|
54
|
+
### Zimbra Proxy Modification
|
55
|
+
|
56
|
+
**Important Note**
|
57
|
+
You are going to modify Zimbra template files, used to build the configuration files of Nginx. **Take some backups!!**
|
58
|
+
|
59
|
+
* All the files are located in `/opt/zimbra/conf/nginx/templates`.
|
60
|
+
* `<`, config being replaced
|
61
|
+
* `>`, new config
|
62
|
+
|
63
|
+
You have to make this modifications
|
64
|
+
|
65
|
+
```diff
|
66
|
+
# nginx.conf.mail.template
|
67
|
+
19c19,20
|
68
|
+
< ${mail.:auth_http}
|
69
|
+
---
|
70
|
+
>
|
71
|
+
> auth_http localhost:9072/service/extension/nginx-lookup;
|
72
|
+
```
|
73
|
+
|
74
|
+
```diff
|
75
|
+
# nginx.conf.web.template
|
76
|
+
17c17
|
77
|
+
< #${web.upstream.:servers}
|
78
|
+
---
|
79
|
+
> server localhost:9080;
|
80
|
+
23c23
|
81
|
+
< #${web.:routehandlers}
|
82
|
+
---
|
83
|
+
> zmroutehandlers localhost:9072/service/extension/nginx-lookup;
|
84
|
+
```
|
85
|
+
|
86
|
+
Next restart. You should restart memcached and nginx, but just to be sure:
|
87
|
+
|
88
|
+
```bash
|
89
|
+
$ zmcontrol restart
|
90
|
+
```
|
91
|
+
|
92
|
+
### Starting Zimbra Intercepting Proxy
|
93
|
+
|
94
|
+
You have to start 2 instances of `ZIP`:
|
95
|
+
|
96
|
+
* One on port `9080` for Web and SOAP Auth Requests, and
|
97
|
+
* One on port `9072` for `Route-Handler`, this is how the Proxy knows to which Mailbox redirect the traffic.
|
10
98
|
|
11
|
-
|
99
|
+
So the first one:
|
12
100
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
4. Paquetizar
|
101
|
+
```bash
|
102
|
+
$ zimbra_intercepting_proxy -d example.com -f /root/users.yml -o oldmailbox.example.com --newmailbox=190.196.215.125 -b 9080 --newmailboxlocalip=192.168.0.
|
103
|
+
```
|
17
104
|
|
18
|
-
|
105
|
+
And the second one:
|
19
106
|
|
20
|
-
|
107
|
+
```bash
|
108
|
+
$ zimbra_intercepting_proxy -d example.com -f /root/users.yml -o oldmailbox.example.com --newmailbox=190.196.215.125 -b 9072 --newmailboxlocalip=192.168.0.
|
109
|
+
```
|
21
110
|
|
22
|
-
|
111
|
+
#### Options
|
23
112
|
|
24
|
-
|
113
|
+
* `-d`, the domain, in case the user only enters the username,
|
114
|
+
* `-o`, the _default_ or old Mailbox,
|
115
|
+
* `--newmailbox`, the _other_ or new Mailbox,
|
116
|
+
* `-f`, the `YAML` map file, with the list of users on the `--newmailbox`,
|
117
|
+
* `-b`, the bind port
|
118
|
+
* `--newmailboxlocalip`, the LAN IP address of the `--newmailbox`
|
25
119
|
|
26
|
-
Add this line to your application's Gemfile:
|
27
120
|
|
28
|
-
|
121
|
+
#### The Map File
|
29
122
|
|
30
|
-
|
123
|
+
It's a simple YAML file with a `email:zimbraId` pair, like
|
31
124
|
|
32
|
-
|
125
|
+
```yaml
|
126
|
+
max@example.com: "7b562c60-be97-0132-9a66-482a1423458f"
|
127
|
+
moliery@example.com: "7b562ce0-be97-0132-9a66-482a1423458f"
|
128
|
+
watson@example.com: "251b1902-2250-4477-bdd1-8a101f7e7e4e"
|
129
|
+
sherlock@example.com: "7b562dd0-be97-0132-9a66-482a1423458f"
|
130
|
+
```
|
33
131
|
|
34
|
-
|
132
|
+
You can get the `zimbraId` with:
|
35
133
|
|
36
|
-
|
134
|
+
```
|
135
|
+
$ zmprov ga watson@example.com zimbraId
|
136
|
+
```
|
37
137
|
|
38
|
-
##
|
138
|
+
## Thanks
|
39
139
|
|
40
|
-
|
140
|
+
* To the Zimbra folks for a great product, and
|
141
|
+
* [@igrigorik](http://twitter.com/igrigorik) for [em-proxy](https://github.com/igrigorik/em-proxy)
|
41
142
|
|
42
143
|
## Contributing
|
43
144
|
|
44
|
-
1. Fork it ( https://github.com/
|
145
|
+
1. Fork it ( https://github.com/pbruna/zimbra_intercepting_proxy/fork )
|
45
146
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
46
147
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
47
148
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -30,8 +30,14 @@ module ZimbraInterceptingProxy
|
|
30
30
|
@backend[:port] = request.port
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
begin
|
34
|
+
conn.server @backend[:host], :host => @backend[:host], :port => @backend[:port]
|
35
|
+
conn.relay_to_servers connection.buffer
|
36
|
+
rescue EventMachine::ConnectionError => e
|
37
|
+
conn.server @backend[:host], :host => ZimbraInterceptingProxy::Config.old_backend, :port => @backend[:port]
|
38
|
+
conn.relay_to_servers connection.buffer
|
39
|
+
end
|
40
|
+
|
35
41
|
|
36
42
|
connection.buffer.clear
|
37
43
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zimbra_intercepting_proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.4.
|
4
|
+
version: 0.0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patricio Bruna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: em-proxy
|