Zimbra Proxy Manual:Advanced Proxy Configuration Examples via CLI
- Please excuse the inline draft notes, this is a working draft that is actively being worded on as a part of our proxy documentation rewrite project. Ajcody - Sept. 10, 2014
Advance Topics For Zimbra Proxy - Advanced Proxy Configuration Examples via CLIAdvanced Proxy Configuration Examples via CLIConfigure Zimbra Proxy For POP[S] And IMAP[S] OnlyDisabling Zimbra Proxy For POP[S] And IMAP[S] OnlyConfigure Zimbra Proxy For POP[S] And IMAP[S] After A HTTP[S] ConfigurationSource: Admin Guide If you need to set up IMAP/POP proxy after you have already installed Zimbra HTTP proxy, do the following below. Assumption is a Zimbra mailbox server/s and the proxy node/s are already setup and running. Note - This section doesn't make sense - this needs to be technically proofed.
Set Up IMAP/POP Proxy with Separate Proxy Node If your configuration includes a separate proxy server, you must do the following. 1. On each Zimbra mailbox server that you want to proxy with, enable the proxy for IMAP/POP proxy. /opt/zimbra/libexec/zmproxyconfig -e -m -H mailbox.node.service.hostname This configures the following: • zimbraImapBindPort to 7143 • zimbraImapProxyBindPort to 143 • zimbraImapSSLBindPort to 7993 • zimbraImapSSLProxyBindPort to 993 • zimbraPop3BindPort to 7110 • zimbraPop3ProxyBindPort to110 • zimbraPop3SSLBindPort to 7995 • zimbraPop3SSLProxyBindPort to 995 • zimbralmapCleartextLoginEnabled to TRUE • zimbraReverseProxyLookupTarget to TRUE • zimbraPop3CleartextLoginEnabled to TRUE 2. Restart services on the proxy and mailbox servers. zmcontrol restart Set Up Proxy Node 1. On each proxy node that has the proxy service installed, enable the proxy for the web. /opt/zimbra/libexec/zmproxyconfig -e -m -H proxy.node.service.hostname This configures the following: • zimbraImapBindPort to 7143 • zimbraImapProxyBindPort to 143 • zimbraImapSSLBindPort to 7993 • zimbraImapSSLProxyBindPort to 993 • zimbraPop3BindPort to 7110 • zimbraPop3ProxyBindPort to110 • zimbraPop3SSLBindPort to 7995 • zimbraPop3SSLProxyBindPort to 995 • zimbraReverseProxyMailEnabled to TRUE Set Up a Single Node If Zimbra proxy is installed with Zimbra Collaboration on the same server, do the following. 1. Enable the proxy for the web. /opt/zimbra/libexec/zmproxyconfig -e -m -H mailbox.node.service.hostname This configures the following: • zimbraImapBindPort to 7143 • zimbraImapProxyBindPort to 143 • zimbraImapSSLBindPort to 7993 • zimbraImapSSLProxyBindPort to 993 • zimbraPop3BindPort to 7110 • zimbraPop3ProxyBindPort to110 • zimbraPop3SSLBindPort to 7995 • zimbraPop3SSLProxyBindPort to 995 • zimbraImapCleartextLoginEnabled to TRUE • zimbraReverseProxyLookupTarget to TRUE • zimbraPop3CleartextLoginEnabled to TRUE • zimbraReverseProxyMailEnabled to TRUE 2. Restart services on the proxy and mailbox servers. zmcontrol restart Disabling Zimbra Proxy For POP[S] And IMAP[S] OnlyConfigure Zimbra Proxy For POP[S] OnlyDisabling Zimbra Proxy For POP[S] OnlyConfigure Zimbra Proxy For POP[S] And HTTP[S] Only
Disabling Zimbra Proxy For POP[S] And HTTP[S] OnlyConfigure Zimbra Proxy For IMAP[S] Only
Disabling Zimbra Proxy For IMAP[S] OnlyConfigure Zimbra Proxy For IMAP[S] And HTTP[S] Only
Disabling Zimbra Proxy For IMAP[S] And HTTP[S] OnlyConfigure Zimbra Proxy For HTTP[S] OnlySource: Admin Guide Draft 'Setting Up HTTP Proxy' To set up HTTP proxy, Zimbra Proxy must be installed on the identified nodes. Note: You can run the command as /opt/zimbra/libexec/zmproxyconfig -r, to run against a remote host. Note that this requires the server to be properly configured in the LDAP master. Set Up HTTP Proxy as a Separate Proxy Node When your configuration includes a separate proxy server follow these steps. 1. On each Zimbra mailbox server that you want to proxy with, enable the proxy for the web. /opt/zimbra/libexec/zmproxyconfig -e -w -H mailbox.node.service.hostname This configures the following: • zimbraMailReferMode to reverse-proxied. See Note below. • zimbraMailPort to 8080, to avoid port conflicts. • zimbraMailSSLPort to 8443, to avoid port conflicts. • zimbraReverseProxyLookupTarget to TRUE • zimbraMailMode to http. This is the only supported mode. 2. Restart services on the proxy and mailbox servers. zmcontrol restart 3. Configure each domain with the public service host name to be used for REST URLs, email, and Briefcase folders. zmprov modifyDomain <domain.com> zimbraPublicServiceHostname <hostname.domain.com> Set Up Proxy Node 1. On each proxy node that has the proxy service installed, enable the proxy for the web. /opt/zimbra/libexec/zmproxyconfig -e -w -H proxy.node.service.hostname This configures the following: • zimbraMailReferMode to reverse-proxied. See Note below. • zimbraMailProxyPort to 80, to avoid port conflicts. • zimbraMailSSLProxyPort to 443, to avoid port conflicts. • zimbraReverseProxyHttpEnabled to TRUE to indicate that Web proxy is enabled. • zimbraReverseProxyMailMode defaults to HTTP. To set the proxy server mail mode, add the -x option to the command with the specific mode: http, https, both, redirect, mixed. Set Up a Single Node for HTTP Proxy If Zimbra proxy is installed along with ZCS on the same server, follow this step. 1. On each zimbra mailbox server that you want to proxy with, enable the proxy for the web. /opt/zimbra/libexec/zmproxyconfig -e -w -H mailbox.node.service.hostname This configures the following: • zimbraMailReferMode to reverse-proxied. See Note below. • zimbraMailPort to 8080, to avoid port conflicts. • zimbraMailSSLPort to 8443, to avoid port conflicts. • zimbraReverseProxyLookupTarget to TRUE • zimbraMailMode to http. This is the only supported mode. • zimbraMailProxyPort to 80, to avoid port conflicts. • zimbraMailSSLProxyPort to 443, to avoid port conflicts. • zimbraReverseProxyHttpEnabled to TRUE to indicate that Web proxy is enabled. • zimbraReverseProxyMailMode defaults to HTTP. To set the proxy server mail mode, add the -x option to the command with the specific mode: http, https, both, redirect, mixed. 2. Restart services on the proxy and mailbox servers. zmcontrol restart Configure each domain with the public service host name to be used for REST URLs, email and Briefcase folders. zmprov modifyDomain <domain.com> zimbraPublicServiceHostname <hostname.domain.com> Disabling Zimbra Proxy For HTTP[S] OnlyConfigure Or Customize The Zimbra Proxy For The Admin Console
Disabling Or Customize The Zimbra Proxy For The Admin ConsoleConfigure Zimbra Proxy For Kerberos AuthenticationSource: Admin Guide Draft, 'Configure Zimbra Proxy for Kerbose Authentication' If you use the Kerberos5 authenticating mechanism, you can configure it for the IMAP and POP proxy. Note: Make sure that your Kerberos5 authentication mechanism is correctly configured. See Chapter 5, Zimbra LDAP Service.
zmprov ms [DNS name.isp.net] zimbraReverseProxyDefaultRealm [ISP.NET]
zmprov mcf +zimbraReverseProxyAdminIPAddress [IP address]
zmprov ms [proxyexample.net] zimbraReverseProxyImapSaslGssapiEnabled TRUE zmprov ms proxyl.isp.net zimbraReverseProxyPop3SaslGssapiEnabled TRUE
zmproxyctl restart
Disabling Zimbra Proxy For Kerberos AuthenticationConfigure Zimbra Proxy For AUTH GSSAPISource: http://wiki.zimbra.com/index.php?title=NGINX_Configuration_Tips#AUTH_GSSAPI Nginx supports the SASL GSSAPI Authentication Mechanism for POP and IMAP through the zimbraReverseProxyPop3SaslGssapiEnabled and zimbraReverseProxyImapSaslGssapiEnabled attributes respectively. Set them to true to enable GSSAPI Authentication for Nginx
Set these attributes to FALSE to disable GSSAPI Authentication. Disabling Zimbra Proxy For AUTH GSSAPIConfigure Zimbra Proxy For AUTH PLAINSource: http://wiki.zimbra.com/index.php?title=NGINX_Configuration_Tips#AUTH_PLAIN Nginx supports enablement of the SASL PLAIN Authentication Mechanism (RFC 4616) for POP and IMAP through the zimbraReverseProxyPop3SaslPlainEnabled and zimbraReverseProxyImapSaslPlainEnabled attributes respectively. Set them to true to enable PLAIN Authentication for Nginx
Set them to false to disable PLAIN Authentication for Nginx
Disabling Zimbra Proxy For AUTH PLAINConfigure Zimbra Proxy For Clear-Text LoginsSource: http://wiki.zimbra.com/index.php?title=NGINX_Configuration_Tips#Allow.2FDisallow_Clear-Text_Logins To configure Nginx to allow/disallow cleartext logins on non SSL/TLS connections, use the zimbraReverseProxyPop3StartTlsMode and zimbraReverseProxyImapStartTlsMode attributes. To allow clear-text logins for POP and IMAP (respectively) over non-SSL/TLS connections, run these commands
To disallow clear-text logins for POP and IMAP (respectively) over non-SSL/TLS connections, run these commands
Disabling Zimbra Proxy For Clear-Text LoginsTo disallow clear-text logins for POP and IMAP (respectively) over non-SSL/TLS connections, run these commands
SSL Certificates Per Domain Set UpSource:
This document explains how to add per domain cert on a ZCS running 7.x version. Until ZCS 6.x, per domain ssl certificate or multiple ssl certificates on a single ZCS was not supported. RFE #8128. From ZCS 7.x, the feature is been added. In this example, I am adding a new domain called example.com and deploying a new certificate for example.com. Prerequisites
1.1.1.1 => example.com 2.2.2.2 => otherdomain.com 3.3.3.3 => yetanotherdomain.com Configure Zimbra Proxy Server1. Make sure Zimbra proxy service is configured correctly and serving https. If not, configure proxy now, run following as zimbra. It will set "zimbraReverseProxyMailMode" to both. su - zimbra /opt/zimbra/libexec/zmproxyconfig -m -w -e -x both -H `zmhostname` 2. Restart proxy service zmproxyctl restart
Configuring IP address and domain1. Add a new ipv4 address to the server which will pair to name example.com (via the example virtual hostname mail.example.com). You can do it using IP address aliasing. For example, the new address can be assigned to eth0:1 device. Lets consider the new ipv4 address is 1.2.3.4 which should be an A record for mail.example.com. The IP address could be public (if server is on Internet) or internal (if the server is behind firewall/NAT'ed). 2. Add the new domain example.com. Set zimbraVirtualHostName to mail.example.com and zimbraVirtualIPAddress to 1.2.3.4. Make sure the zimbraVirtualHostName is set to the name which will be used to access the domain (URL) and the SSL certificate is signed for same name. zmprov cd example.com zimbraVirtualHostName "mail.example.com" zimbraVirtualIPAddress "1.2.3.4" NOTE: If the server is behind firewall and NAT'ed with external address, make sure the external requests for "mail.example.com" hits the aliased IP address and not the actual local IP of server. Verifying and Preparing the CertificatesWe have three files received from the CA. The server (domain) certificate, two chain certs. And we have existing key file (which was used to generate the csr) 1. Save the example.com certificate, key and chain files to a directory /tmp/example.com. You can receive single or multiple chain certs from your CA. Here we have two chain certs from the CA. i.e. example.com.root.crt and example.com.intermediate.crt. ls /tmp/example.com example.com.key example.com.crt example.com.root.crt example.com.intermediate.crt 2. Add the chain certs to a single file called example.com_ca.crt cat example.com.root.crt example.com.intermediate.crt >> example.com_ca.crt 3. Confirm if the key and certificate matches and chain certs completes the trust. /opt/zimbra/bin/zmcertmgr verifycrt comm /tmp/example.com/example.com.key /tmp/example.com/example.com.crt /tmp/example.com/example.com_ca.crt
** Verifying example.com.crt against example.com.key Certificate (example.com.crt) and private key (example.com.key) match. Valid Certificate: example.com.crt: OK Deploying the Certificate on domain1. Add the domain certificate and chain files to a single file called example.com.bundle cat example.com.crt example.com_ca.crt >> example.com.bundle 2. Run following to save the certificates and key in ldap database. /opt/zimbra/libexec/zmdomaincertmgr savecrt example.com example.com.bundle example.com.key
/opt/zimbra/libexec/zmdomaincertmgr savecrt <domainname> <certificate with chain certs> <keyfile> 3. Run following to deploy the domain certificate. This will save the certificate and key as /opt/zimbra/conf/domaincerts/example.com /opt/zimbra/libexec/zmdomaincertmgr deploycrts 4. Make sure the example.com is resolving to its local IP address from Zimbra host. Or make an similar entry in /etc/hosts file. 1.2.3.4 example.com 5. Restart proxy service to take the changes in effect. zmproxyctl restart 6. Once the restart is successfull, try to access the domain using the URL which is set in "zimbraVirtualHostName" over https. And check the certificate loaded in the browser. In this case the URL will be https://example.com TestingRun this command locally on zimbra server to check if the correct domain cert is offered while accessing the domain with "zimbraVirtualHostName" or "zimbraVirtualIPAddress" openssl s_client -connect example.com:443 openssl s_client -connect 1.2.3.4:443 Troubleshooting
Starting nginx...nginx: [emerg] SSL_CTX_use_PrivateKey_file("/opt/zimbra/conf/domaincerts/example.com.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
|