Sympa Mlist Manager Integration Howto

From Kolab Wiki

Jump to: navigation, search
This page applies to Kolab 2.

Sympa is a Free Software mailing list manager which have some very unique features like:

- ldap integration
   - User Authentication
   - Dynamic Mailing Lists
- RDBMS support (you need a mysql server to store subscription informations)
- X509v3 encrypted mailing lists
- Web archives
etc, etc,etc ...

This HOWTO is not well formatted because it's the first time i use wiki and could contain some errors because i'm writing it after at least 2 months from the sympa integration.

http://www.sympa.org

The integration of Sympa require the following conceptual steps:

- install needed perl modules and all it's own dependancies
- install mysql RDBMS database
- modify postfix configuration to support
  - define a sympa transport in master.cf
  - define the transport rules for domain dedicated to mailing lists
  - define the rewrite rules needed in order to support without any effort sympa
- modify apache configuration to supporto sympa web based interface
- configure sympa to use the ldap directory for user authentication
- configure sympa to user distribution lists for Dynamic Mailing Lists

Now we need to install and compile mysql: cd /kolab/RPM/SRC wget -b ftp://ftp.openpkg.org/release/2.4/SRC/mysql-4.1.12-2.4.0.src.rpm

Create an obmtool.conf definition for mysql and install it: cp obmtool.conf obmtool-new.conf

Edit obmtool-new.conf vim obmtool-new.conf

Remove all kolab packages definitions ( @install ) change loc definition to ./

 loc='./' 

Insert the mysql one: @install ${loc}mysql-4.1.12-2.4.0

Install it: ./obmtool -c obmtool-new.conf kolab

- Installation of Sympa needed modules

Load kolab environment:

eval `/kolab/bin/openpkg rc --eval all env`

Install (on debian) lynx console web browser (used by CPAN shell)

apt-get install lynx

Start the perl CPAN shell in order to install the needed modules

/kolab/bin/perl -MCPAN -e shell
 install DBI::DBD
 force install DBD::mysql
 force install Locale::TextDomain
 install E/EH/EHOOD/MHonArc-2.6.15.tar.gz
 install XML::LibXML::Common
 install XML::LibXML
 install Sub::Uplevel
 install Test::Builder::Tester
 install Test::Exception
 install Module::Build
 install Array::Compare
 install Test::Warn
 force install Crypt::CipherSaber
 quit


Now download and install Sympa:

 cd /kolab/RPM/SRC
 wget http://www.sympa.org/distribution/sympa-5.1.tar.gz
 tar zxvf sympa-5.1.tar.gz
 cd sympa-5.1
 ./configure \
 --with-prefix=/kolab/lib --prefix=/kolab/lib/sympa/ \
 --with-confdir=/kolab/etc/sympa --with-etcdir=/kolab/etc/sympa \
 --with-initdir=/kolab/etc/rc.d --with-piddir=/kolab/var/sympa \
 --with-spooldir=/kolab/var/spool/sympa --with-expldir=/kolab/lib/sympa/expl \
 --with-libexecdir=/kolab/libexec/sympa/bin --with-cgidir=/kolab/var/kolab/www/cgi-bin \
 --with-user=kolab-n --with-group=kolab-n \
 --with-bindir=/kolab/lib/sympa --bindir=/kolab/lib/sympa/bin \
 --with-sbindir=/kolab/lib/sympa --with-libdir=/kolab/lib/sympa/bin \
 --with-datadir=/kolab/share/sympa --with-iconsdir=/kolab/share/sympa/icons \
 --with-mandir=/kolab/man --with-virtual_aliases=/kolab/etc/postfix/aliases \
 --with-newaliases=/kolab/sbin/newaliases

Before building all the perl stuff of sympa we still need to install the SUID PERL. Unfortunatelly it is not available as a OpenPKG package, so we install it from debian distribution:

 apt-get install perl-suid

Now compile and install sympa in the /kolab environment:

 make
 make install

Now do the first needed activity for integration in the kolab environment:

- Mysql setup
  /kolab/bin/openpkg rc mysql start
  mysqladmin -uroot -p create sympa
  mysql -uroot -p
   GRANT ALL PRIVILEGES ON sympa.* TO 'sympa'@'%' IDENTIFIED BY 'sympa' WITH GRANT OPTION;
   quit 
  /kolab/bin/openpkg rc mysql stop
- Postfix setup
 - main.cf
  vim /kolab/etc/kolab/templates/main.cf.template
   Add /kolab/etc/postfix/transport_regexp to postfix transport_maps table: 
    transport_maps = hash:/kolab/etc/postfix/transport, ldap:/kolab/etc/postfix/ldaptransport.cf,regexp:/kolab/etc/postfix/transport_regexp
   Add /kolab/etc/postfix/transport_regexp to local_recipient_maps table:
    local_recipient_maps = $virtual_maps, $alias_maps, regexp:/kolab/etc/postfix/transport_regexp
   Add /kolab/etc/postfix/virtual_regexp to virtual_alias_maps table: 
    virtual_alias_maps= regexp:/kolab/etc/postfix/virtual_regexp
   
   Add the limitation to deliver only one email per time to sympa & sympabounce transport:
    sympa_destination_recipient_limit = 1
    sympabounce_destination_recipient_limit = 1


ln -s /kolab/var/spool/sympa/bounce /kolab/lib/sympa/bounce # (don't ask me why... i don't remember)

 - master.cf
   - Create the transport definitions of sympa to allow postfix to do delivery
    vim /kolab/etc/kolab/templates/master.cf.template
     sympa        unix  -       n       n       -       -       pipe flags=R user=kolab-n argv=/kolab/lib/sympa/queue ${recipient}$
     sympabounce  unix  -       n       n       -       -       pipe flags=R user=kolab-n argv=/kolab/lib/sympa/bouncequeue ${user}$
 - virtual_regexp: Rewrite all email with embedded commands for sympa:
 vim /kolab/etc/postfix/virtual_regexp
  /^(.*)-owner\@(.*)$/                    $1+owner@$2

 - transport_regexp is needed to the mailing list domains that need to be managed by sympa instead of kolab:
  vim /kolab/etc/postfix/transport_regexp
   /^.*+owner\@example\.domain\.com$/ sympabounce:
   /^.*\@example\.domain\.com$/       sympa:
   Please notice that the domains used for mailing lists has to be addedd as the managed domains of kolab trough the kolab web admin interface.
 Now create the sympa configuration files:
vim /kolab/etc/sympa/sympa.conf
 home    /kolab/lib/sympa/expl
 etc     /kolab/etc/sympa
 pidfile /kolab/var/sympa/sympa.pid
 umask   027
 localedir       /kolab/lib/sympa/locale
 spool   /kolab/var/spool/sympa
 queue   /kolab/var/spool/sympa/msg
 queuebounce     /kolab/var/spool/sympa/bounce
 syslog  LOCAL1
 log_socket_type unix
 log_level       0
 sympa_priority  1
 lang    it
 default_list_priority   5
 cookie  655058604
 max_size        5242880
 rfc2369_header_fields   help,subscribe,unsubscribe,post,owner,archive
 remove_headers  Return-Receipt-To,Precedence,X-Sequence,Disposition-Notification-To
 bounce_warn_rate        30
 bounce_halt_rate        50
 expire_bounce_task      daily
 welcome_return_path     owner
 remind_return_path      owner
 sendmail        /kolab/sbin/sendmail
 nrcpt   25
 avg     10
 maxsmtp 40
 #openssl /kolab/bin/openssl
 #cafile  /kolab/etc/kolab/ca/cacert.pem
 #ssl_cert_dir    /kolab/lib/sympa/expl/X509-user-certs
 dark_color      #006666
 selected_color  #996666
 light_color     #cccc66
 shaded_color    #66cccc
 bg_color        #ffffcc
 db_type mysql
 db_name sympa
 db_host       localhost
 db_user       sympa
 db_passwd     sympa
 wwsympa_url     http://CHANGEME/sympa
 css_url     http://CHANGEME/sympa/css
 domain  CHANGEME
 listmaster      CHANGEME@CHANGEME
 #create_list    public_listmaster@CHANGEME
 email   sympa

Now configure the authentication source of sympa to use the kolab ldap source. You must configure the DN:

vim /kolab/etc/sympa/auth.conf
 ldap
 regexp                          .*
 host                            localhost:389
 timeout                         30
 suffix                          dc=CHANGEME,dc=CHANGEME,dc=CHANGEME
 get_dn_by_uid_filter            (uid=[sender])
 get_dn_by_email_filter          (mail=[sender])
 email_attribute                 mail
 scope                           sub

FIXME: With the ldap integration i'm not able to use mysql user base (users external to kolab managed one). I've done several attempt to use sympa RDBMS user base along with Kolab's ldap one without success.

Now add enable the CGI to access sympa web administration interface:

vim /kolab/etc/kolab/template/httpd.local.template 
 Alias /sympaicons /kolab/share/sympa/icons
 ScriptAlias /sympa /kolab/var/kolab/www/cgi-bin/wwsympa.fcgi
 AddHandler cgi-script .fcgi

FIXME: Insert automatic alias wrapper http://www.sympa.org/fom-serve/cache/219.html

FIXME: better startup script Now configure the startup script. Notice that sympa start with the command /kolab/etc/rc.d/sympa but we need to configure a proper OpenPKG compliant startup script:

cd /kolab/etc/rc.d
cp -p rc.postfix rc.sympa
vim rc.sympa (change/remove garbage of another script)
 /kolab/etc/rc.d/sympa start
 /kolab/etc/rc.d/sympa stop

Fix the sympa startup scripts to remove hardcoded /var/lock/sybsys value

vim sympa
 :%s?/var/lock/subsys?/kolab/var/sympa


Now configure the environment startup to include sympa + mysql:

vim /kolab/etc/kolab/templates/rc.conf.template
 mysql_enable="yes"
 sympa_enable="yes"


A special additional feature that only sympa is able to provide is the creation of Dynamic Mailing Lists. Dynamic Mailing Lists are lists of users, following specific rules of moderation/archivial/access defined by the administrator, that get the subscribed list email addresses from an ldap sources.

To create a Dynamic Mailing Lists, create a mailing list trough the web admin interface.

Then edit the list configuration files in order to use a dara sorce coming from ldap.

vim /kolab/lib/sympa/expl/[listname]/config

ttl 240 user_data_source include2

       include_ldap_2level_query
               host            localhost:389
               suffix1         cn=dl_name,dc=[CHANGEME],dc=[CHANGEME],dc=[CHANGEME]
               timeout1        30
               filter1         (objectClass=kolabGroupOfNames)
               attrs1          member
               select1         all
               scope1          sub
               suffix2         [attrs1]
               timeout2        30
               filter2         (objectClass=kolabInetOrgPerson)
               attrs2          mail
               scope2          sub
               select2         all

Please notice that the subscribed lists is not retrieved in realtime but periodically crawled by the sympa server components on a time basis on the "ttl" .

Personal tools