Kolab2 Integration with mailman
From Kolab wiki
This is a small howto on using Mailman with Kolab. This was tested on a debian testing running
Mailman 2.1.7 and Kolab 2.0.3, but I think this howto should be easily adaptable to other distros.
General information about Mailman integration with Postfix can be found here: http://homex.subnet.at/~max/mail/mailman.php
To not adapt your aliases files for every new created mailing we add a new file in /kolab/etc/postfix/virtual-regexp. containing the following:
/^(postmaster|root|abuse)@list\.cerdd\.org$/ listmaster at cerdd.org /^([-a-zA-Z0-9_]+)-(post|bounces|admin|request|owner|on|off)@list\.cerdd\.org$/ mailman-$2+$1 /^([-a-zA-Z0-9_]+)@list\.cerdd\.org$/ mailman-post+$1
Of course you should replace the domain part with your own :)
Now you need to configure postfix to make use of this file. So you need to do some changes in /kolab/etc/kolab/templates/main.cf.template
Apend the follwing to the line starting with virtual_maps. regexp:/kolab/etc/postfix/virtual-regexp. After that this line should look like this:
virtual_maps = hash:/kolab/etc/postfix/virtual, ldap:ldapdistlist, ldap:ldapvir tual, regexp:/kolab/etc/postfix/virtual-regexp
At last you need some aliases in /kolab/etc/postfix/aliases
mailman-post: "|/var/lib/mailman/mail/wrapper post $EXTENSION" mailman-admin: "|/var/lib/mailman/mail/wrapper admin $EXTENSION" mailman-request: "|/var/lib/mailman/mail/wrapper request $EXTENSION" mailman-owner: "|/var/lib/mailman/mail/wrapper owner $EXTENSION" mailman-on: "|formail -I'Subject: subscribe'|/var/lib/mailman/mail/wrapper mailc md $EXTENSION" mailman-off: "|formail -I'Subject: unsubscribe f'|/var/lib/mailman/mail/wrapper mailcmd $EXTENSION" mailman-bounces: "|/var/lib/mailman/mail/wrapper bounces mailman" mailman-confirm: "|/var/lib/mailman/mail/wrapper confirm mailman" mailman-join: "|/var/lib/mailman/mail/wrapper join mailman" mailman-leave: "|/var/lib/mailman/mail/wrapper leave mailman" mailman-subscribe: "|/var/lib/mailman/mail/wrapper subscribe mailman" mailman-unsubscribe: "|/var/lib/mailman/mail/wrapper unsubscribe mailman"
After editing this file You need to refresh your aliases db by runnig the postalias command in /kolab/sbin/postalias.
Now you have done all prequisits to give your mailman a run, but unfortunately we need to treat the mailman wrapper a little bit as he assumes that he is run be an user with the guid of "deamon". This may differ in your distro but this is the default here on the debian system. Since postfix is run as kolab-n the wrapper won't do his work :(.
Now we have two options:
- 1. change the uid of postfix to the expected value of the wrapper (depreciated)
- 2. change the wrapper in the way the he expects to be run by kolab-n
The first method is depreciated as this might affect the whole kolab installation, so lets focus on the second one.
The guid thing is compiled into the wrapper so we need to compile a new version. Get your copy of the mailman sources from http://www.gnu.org/software/mailman/download.html
To comile your version with the correct values start your ./configure script with some options:
./configure --with-username=list --with-groupname=list --with-mail-gid=kolab-n --without-permcheck --prefix=/var/lib/mailman
After that do make (not make install!!!). If all goes well there should be a new version of the mailman binary in the src-folder in the mailman dir. Take this binary and replace it with the existing file of your installation. On debian this is located in /var/lib/mailman/mail/.
Now your setup is complete and you can give your mailman a test. Please examine your log files to verify that all os configured right.
