A Step-by-step guide for installing Sympa on CentOS 5.
Introduction
Sympa is a mailing list manager tool designed to manage the sending of e-mails to database-backed subscriber lists. Sympa is one of the few open-source tools available with the features it offers: support for Oracle, MySQL, PostgreSQL lists and queries, bulk mail process management, SOAP API interoperability, and various levels of editor approval for outgoing messages. Sympa has been tested at sending 25,000 messages out in under 10 minutes with an acceptable server load. Sympa hosts archives of messages, can provide URLs for shared attachments and documents, is translated into 20 languages, and provides options for RSS feeds and threaded discussions.
Sympa was made by students in the French university system, designed mostly in Perl. However, the most recent version at the time of this writing offers even more functionality, and a new web interface. Authors: Serge Aumont, Olivier Salaün, David Verdin
Installation
Use yum to install these packages:
gettext-devel libxml2
mysql mysql-devel ( or postgres postgres-devel )
openssl openssl-devel
postfix dovecot system-switch-mail
httpd
To configure postfix, I found this link to be quite helpful:
http://wiki.centos.org/HowTos/postfix
Run system-switch-mail
and select Postfix as the MTA.
Download the sympa source code from:
http://www.sympa.org
Use proper ./configure options. Some problems arise in testing when not deciding where to point these directories in the first place. Example:
./configure --prefix=/home/sympa \
--with-bindir=/home/sympa/bin \
--with-sbindir=/home/sympa/bin \
--with-libexecdir=/home/sympa/bin \
--with-cgidir=/home/sympa/bin \
--with-libdir=/home/sympa/bin \
--with-openssl=/usr/bin/openssl \
--with-sendmail_aliases=/home/sympa/etc/sympa_aliases \
--with-user=sympa \
--with-group=sympa \
--with-etcdir=/home/sympa/etc \
--with-newaliases=/usr/bin/newaliases \
--with-postmap=/usr/sbin/postmap \
--with-virtual_aliases=/etc/postfix/virtual_alias_maps \
--with-perl=/usr/bin/perl \
--with-spooldir=/var/spool/mail/sympa \
--enable-secure
Create a separate aliases file for sympa, apart from postfix’s standard /etc/aliases or /etc/mail/aliases. In the configuration example above, /home/sympa/etc/aliases has been specified. Add this file and path to your postfix main.cf:
alias_maps = hash:/etc/aliases,hash:/home/sympa/etc/sympa_aliases
Perl modules
Allow sympa install to check for all required perl modules. sympa_wizard.pl --check
Install the perlmoduleinstaller tool, available on sourceforge.net, to assist in installing perl modules. Perlmod syntax:
sudo perlmod -i XML::LibXML # installs the module
perlmod -l # lists all modules installed
Some Perl modules required additional libraries to be installed, such as XML::LibXML, which requires libxml2 and libxml2 sources, and Net::SSLeay, which requires openssl sources (openssl-devel).
Database configuration
Individual scripts are pre-made for auto-creating MySQL or Oracle databases. Configure database options in /etc/sympa.conf such as
db_type Oracle, db_name, db_host, db_user, db_passwd, db_env (ORACLE_HOME)
MySQL: Run this to create the database, entering your mysql password when prompted:
mysql -u root -p </home/sympa/bin/create_db.mysql
Change the sympa password and check mysql permissions:
grant all on sympa.* to "sympa"@"localhost" identified by "password"; show grants for 'sympa'@'localhost'; set password for 'sympa'@'localhost' = PASSWORD('password'); flush privileges;
PostgreSQL:
When you start /etc/init.d/sympa for the first time, it checks to see if the database has been created. You will want to create it manually by using the createdb postgres script. If you are on a virtual machine, you may need to check the
NETWORKING=/etc/sysconfig/network
variable in the startup script.
Create the postgres database and user:
# sympa db CREATE ROLE sympa NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOLOGIN; # sympa user CREATE ROLE sympa NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT LOGIN ENCRYPTED PASSWORD '{password}'; GRANT sympa TO sympa; CREATE DATABASE sympa WITH OWNER=sympa; psql -U sympauser -d sympadb -h localhost < /home/sympa/bin/create_db.Pg
Double check your postgres pg_hba.conf:
host samerole all 127.0.0.1/32 md5
Confirm that db_name and db_user are set correctly in /etc/sympa.conf.
Apache configuration Often, admins complain about not having a full example of an apache configuration. Here is an example apache httpd.conf:
User sympa Group sympa LoadModule fcgid_module /usr/local/apache2/modules/ mod_fcgid.so Alias /static-sympa /home/sympa/static_content ScriptAlias /sympa /home/sympa/bin/wwsympa.fcgi <IfModule mod_fcgid.c> AddHandler fcgid-script .fcgi IdleTimeout 600 ProcessLifeTime 7200 DefaultMaxClassProcessCount 100 SocketPath /tmp/fcgid/sock IPCConnectTimeout 120 IPCCommTimeout 120 MaxProcessCount 3 </IfModule> <Directory "/home/sympa/static_content"> Order allow,deny Allow from xx.xx.xx.xx </Directory> <Directory "/home/sympa/bin/"> <Files "*.fcgi"> Order allow,deny Allow from xx.xx.xx.xx </Files> </Directory> <Location /sympa> Allow from xx.xx.xx.xx </Location> # Oracle settings: needed if you use Oracle SetEnv LD_LIBRARY_PATH /oracle/product/10g/lib # Perl library path: SetEnv PERL5LIB /usr/lib/perl5/site_perl/5.8.8/ i586-linux-thread-multi/DBI
Sudo rights
Sympa requires sudo access to the core scripts, as well as to the postfix aliases.
sympa LOCAL = NOPASSWD:/home/sympa/bin/wwsympa.fcgi, /home/sympa/bin/wwsympa_sudo_wrapper.pl, /home/sympa/bin/wwsympa-wrapper.fcgi, /home/sympa/bin/sympa_soap_server-wrapper.fcgi sympa LOCAL = NOPASSWD:/home/sympa/bin/alias_wrapper.pl, /usr/bin/newaliases,/home/sympa/bin/aliaswrapper, /home/sympa/bin/alias_manager.pl,/usr/sbin/postalias, /usr/sbin/postmap,/etc/init.d/sympa
Coming in future updates:
Postfix mail configuration
DNS configuration