ZCS Mailman Integration
HOWTO: Integrate Zimbra Collaboration Suite with Mailman mailing lists
- Getting started
- Configuring Mailman
- Configuring ZCS
- Further integration with Zimbra
- Possible configurations (unsupported)
Many administrators would like to have robust mailing list management in conjunction with Zimbra. ZCS has distribution lists which works well for small groups with a central management interface; however, it does not provide support for self-help subscription, moderation or digests. Using ZCS together with Mailman is one way to fulfill the requirements, but requires a bit of massaging to work as one would expect.
One method of integration can be found on our forums at http://www.zimbra.com/forums/administrators/1380-solved-zimbra-mailman-howto.html
The above guide will allow a single-node ZCS install to coexist with Mailman on a single server, however, your mileage may vary. The referenced setup requires manual building of Mailman, integration with Zimbra/Apache-HTTPD, Zimbra-Postfix config changes and the work required to make it work does not appear to be insignificant. The guide also places restrictions on the email-domain that can be served by Mailman lists on the server.
In this guide, we will elaborate on a dual/multi-node ZCS/Mailman setup with step-by-step instructions as well provide patches to Mailman with a Python library to automatically interface with Zimbra. There will be no restriction on the domain which Mailman can serve. In addition to integrating Mailman, one can take the general ideas introduced by this document and apply it to any other list-serv of choice.
2. Getting started
Our supported configuration for using Mailman with Zimbra is to have Mailman on an external dedicated node. We do not want to have the Mailman setup interfering with the ZCS configuration.
This guide assumes knowledge of working with ZCS and the ability to get the basics of Mailman configured (such as installation, Apache HTTPD configuration, and mailing list management). Additionally, for convenience, we will assume that the setup will be performed on RHEL.
To continue, we will need:
- An additional server where we will run Mailman
- The name of the MTA for Zimbra (ZIMBRA_MTA_HOST)
- The name of the host on which Mailman will run (MAILMAN_HOSTNAME)
- The domain name for which we are receiving email (EMAIL_DOMAIN)
- To create an admin password for Mailman (MAILMAN_ADMIN_PASSWORD)
- To create a list creator password for Mailman (MAILMAN_CREATOR_PASSWORD)
3. Configuring Mailman
First, install Mailman and postfix; on RHEL 5, we do:
$ rpm -e --nodeps sendmail $ yum install mailman postfix
which pulls down all dependencies such as httpd if it was not already present. It also forcibly removes sendmail and replaces it with postfix.
Edit /etc/mailman/mm_cfg.py set the variables:
DEFAULT_URL_HOST = 'MAILMAN_HOSTNAME' DEFAULT_EMAIL_HOST = 'EMAIL_DOMAIN'
Create the site-wide mailing list (default is 'mailman') and any other desired mailing lists:
$ /usr/lib/mailman/bin/newlist mailman
specify any valid email address as the list owner (including any address that is hosted on ZCS).
Edit and update /etc/aliases as directed by the output of the 'newlist' command. Run
to update the aliases table to include the mailing list addresses.
Setup the Mailman administrative passwords:
$ /usr/lib/mailman/bin/mmsitepass MAILMAN_ADMIN_PASSWORD $ /usr/lib/mailman/bin/mmsitepass -c MAILMAN_CREATOR_PASSWORD
Configure postfix to accept email on EMAIL_DOMAIN and redirect unknown addresses to user@EMAIL_DOMAIN back into Zimbra (this will cover the cases where users on ZCS will also be included in the mailing lists)
Edit /etc/postfix/main.cf and set:
mydomain = EMAIL_DOMAIN myorigin = $mydomain mydestination = $mydomain local_recipient_maps = fallback_transport = smtp:ZIMBRA_MTA_HOST
We are now ready to (re)start the mail, httpd and mailman services, do the following:
$ chkconfig httpd on $ chkconfig postfix on $ chkconfig mailman on $ service httpd restart $ service postfix restart $ service mailman restart
4. Configuring ZCS
NOTE: This section can be bypassed if one follows the directions in '5. Further integration with Zimbra' below.
Now that Mailman has been properly configured, we will need to setup the addresses that will forward from ZCS to the Mailman host.
$ zmprov ca LIST_NAME@EMAIL_DOMAIN ANY_RANDOM_PASSWORD $ zmprov ma LIST_NAME@EMAIL_DOMAIN zimbraMailTransport MAILMAN_HOSTNAME
$ zmprov ca LIST_NAME-admin@EMAIL_DOMAIN ANY_RANDOM_PASSWORD $ zmprov ma LIST_NAME-admin@EMAIL_DOMAIN zimbraMailTransport MAILMAN_HOSTNAME
$ zmprov ca LIST_NAME-bounces@EMAIL_DOMAIN ANY_RANDOM_PASSWORD $ zmprov ma LIST_NAME-bounces@EMAIL_DOMAIN zimbraMailTransport MAILMAN_HOSTNAME
Repeat the ca/ma commands above for the remaining -confirm, -join, -leave, -owner, -request, -subscribe, and -unsubscribe aliases.
With the above configuration complete, we may now use fully-featured mailing lists at LIST_NAME@EMAIL_DOMAIN.
5. Further integration with Zimbra
We can offer tighter integration of Mailman with ZCS using the attached ZimbraIntegration.py (to be installed in MAILMAN_HOME/Mailman). A simple patch to the Mailman installation in conjunction with the aforementioned ZimbraIntegration.py will enable us to ignore section 4 above altogether.
With the zimbra_mailman_integration.patch applied against Mailman every invocation of 'newlist', 'rmlist' and create/delete list from the web interface will automatically issue the appropriate zmprov commands to ZCS. Zimbra accounts with the zimbraMailTransport setting will be configured as necessary for the specified LIST_NAME.
To apply the integration, copy ZimbraIntegration.py into MAILMAN_HOME/Mailman, on systems where we installed Mailman using the RPM, it will be /usr/lib/mailman. Apply the patch:
$ cd /usr/lib/mailman; patch -p0 < zimbra_mailman_integration.patch
Edit /etc/mailman/mm_cfg.py, add the variables:
OWNERS_CAN_DELETE_THEIR_OWN_LISTS = True # enable deleting lists from web UI ZIMBRA_ADMIN_SOAP_SERVICE = 'https://ZCSHOST:7071/service/admin/soap/' MAILMAN_SMTP_TRANSPORT = 'MAILMAN_HOSTNAME' ZIMBRA_ADMIN_USERNAME = 'YOUR_ZCS_ADMIN_USERNAME' ZIMBRA_ADMIN_PASSWORD = 'YOUR_ZCS_ADMIN_PASSWORD'
ZimbraIntegration.py exposes some APIs that can be re-used by non-Mailman list-servs and can serve as an example for users that might want to integrate ZCS with another list-serv.
6. Possible configurations (unsupported)
For small configurations, it is possible to run Mailman on the same host as ZCS, although strictly unsupported.
This is possible because Zimbra installs its own postfix into /opt/zimbra/postfix, the system may retain its own postfix installation and use that configuration to communicate to Mailman on the same node. The system-version of postfix must listen on a different port (ALT_SMTP_PORT) from the Zimbra-version of postfix. The zimbraMailTransport directive above would become smtp:ZIMBRA_MTA_HOST:ALT_SMTP_PORT
The remaining integration into Zimbra's Apache HTTPD configuration is left as an exercise to the reader.
6.1 Using a different mailing list manager (other than Mailman)
Following this guide presented thus-far, similar principles may be applied to any list-serv with respect to email routing and integration using ZimbraIntegration.py.