Mailman
This wiki document explains howto setup [http://www.list.org/ Mailman] mailing list software with apache web server and exim mail server in ubuntu linux. The intended audience are experienced linux users and system administrators.
Introduction
If you are new to Mailman, this section provides a quick introduction about Mailman.
Mailman is a free software for managing electronic mail discussion and e-newsletter lists. Many open source mailing lists use Mailman as their mailing list software. It is powerful, easy to install and easy to maintain.
Assumptions
It is assumed that you are aware of running linux commands, editting files, starting/stopping services in the linux system. It is also assumed that ubuntu linux is running, you have root user access and you want to use Mailman software.
It is also assumed you have internet connection and you have configured /etc/apt/sources.list.
Installation
Mailman provides the web interface for the administrators and users. So, it requires apache with mod_perl support. Mailman uses an external mailserver to send/receive emails. It is proven that mailman works perfect with the following mailservers::
[http://www.postfix.org Postfix]
[http://www.exim.org Exim]
[http://www.sendmail.org Sendmail]
[http://qmail.org/top.html Qmail]
In this section, we will see howto install mailman, apache web server and Exim mail server. We will use mailman 2.1.5-x, apache 2.0.54-x and exim 4.52-2. If you wish to install mailman with different mail server, please refer the references pages. The references are given at the end of this page.
Apache2
Apache2 is already in the repository. So, to install apache2 you run::
- # apt-get install apache2
- # apt-get install apache2-common
Exim4
Exim4 is already in the repository. So, to install exim4 you run::
- # apt-get install exim4
- # apt-get install exim4-base
- # apt-get install exim4-config
Once exim4 is installed, the configuration files are stored in /etc/exim4/. In ubuntu, by default, the exim4 configuration files are splitted accross different files. You can change this behaviour by changing the following variable in /etc/exim4/update-exim4.conf.conf file.
- dc_use_split_config='true'
We can discuss more about exim4 configuration in next section.
If you face any problem during installation and if you are unable to solve it, please refer appropriate mailing lists for further assistance.
Mailman
Mailman is already in the repository. So, to install mailman you run::
- # apt-get install mailman
It copies the installation files in /var/lib/mailman. It installs the cgi scripts in /usr/lib/cgi-bin/mailman' directory.
It creates 'list' linux user'. It creates 'list' linux group. The mailman process would be owned by this user.
Configuration
This section assumes you have successfully completed the installation of mailman, apache and exim4. Here, we will discuss about configuration. At the end of this section, your mailman would be ready to rock!
Apache
Once apache2 is installed, you can run it using the following command::
- # /etc/init.d/apache2 start
Mailman uses apache to render its CGI scripts. The mailman CGI scripts are installed in /usr/lib/cgi-bin/mailman. So, the mailman url would be http://hostname/cgi-bin/mailman/. You can make changes to /etc/apache2/apache2.conf file if you wish to change this behaviour.
Exim4
Once exim4 is installed, you can run it using the following command::
- # /etc/init.d/exim4 start
In order to make mailman work with exim4, you are supposed to configure exim4. As mentioned earlier, by default, exim4 uses multiple configuration files of different types. For details, please refer [http://www.exim.org Exim] website.
To run mailman, we should make add new configuration file to the following configuration types::
- Main
- Transport
- Router
Exim creates a master configuration file, by sorting all these mini configuration files. So, the order of these configuration files is important.
Main
All the configuration files belonging to main type are stored in /etc/exim4/conf.d/main/ directory. You can add the following content in a new file. You may name it as 04_exim4-config_mailman::
# start # Home dir for your Mailman installation -- aka Mailman's prefix # directory. # By default this is set to "/usr/local/mailman" # On a Red Hat/Fedora system using the RPM use "/var/mailman" # On Debian using the deb package use "/var/lib/mailman" # This is normally the same as ~mailman MM_HOME=/var/lib/mailman # # User and group for Mailman, should match your --with-mail-gid # switch to Mailman's configure script. Value is normally "mailman" MM_UID=list MM_GID=list # # Domains that your lists are in - colon separated list # you may wish to add these into local_domains as well domainlist mm_domains=bluestar.co.in # # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # These values are derived from the ones above and should not need # editing unless you have munged your mailman installation # # The path of the Mailman mail wrapper script MM_WRAP=MM_HOME/mail/mailman # # The path of the list config file (used as a required file when # verifying list addresses) MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck # end
Transport
All the configuration files belonging to transport type are stored in /etc/exim4/conf.d/transport/ directory. You can add the following content in a new file. You may name it as 40_exim4-config_mailman::
mailman_transport: driver = pipe command = MM_WRAP \ '${if def:local_part_suffix \ {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1\}\}\} \ {post}}' \ $local_part current_directory = MM_HOME home_directory = MM_HOME user = MM_UID group = MM_GID
IMPORTANT: In the above configuration, in line no 5, i've escaped three braces (\}\}\}) to make it compatible with this document. Please unescape it when you save this file.
Router
All the configuration files belonging to router type are stored in /etc/exim4/conf.d/router/ directory. You can add the following content in a new file. You may name it as 101_exim4-config_mailman::
mailman_router: driver = accept require_files = MM_HOME/lists/$local_part/config.pck local_part_suffix_optional local_part_suffix = -bounces : -bounces+* : \ -confirm+* : -join : -leave : \ -owner : -request : -admin transport = mailman_transport
IMPORTANT: The order of main and transport configuration files can be in any order. But, the order of router configuration files must be in the same order. This particular file, must appear before 200_exim4-config_primary file. These two configuration files contain same type of information. The first file takes the precedence. For more details, please refer the [http://www.exim.org exim] website or references section in this page.
Mailman
Once mailman is installed, you can run it using the following command:
- # /etc/init.d/mailman start
Once mailman is installed, it is expected to create the default mailing list. To create the default mailing list, you can run the following command:
# newlist mailman Enter the email of the person running the list: bhuvaneswaran at NOSPAM gmail.com Initial mailman password: To finish creating your mailing list, you must edit your /etc/aliases (or equivalent) file by adding the following lines, and possibly running the `newaliases' program: ## mailman mailing list mailman: "|/var/lib/mailman/mail/mailman post mailman" mailman-admin: "|/var/lib/mailman/mail/mailman admin mailman" mailman-bounces: "|/var/lib/mailman/mail/mailman bounces mailman" mailman-confirm: "|/var/lib/mailman/mail/mailman confirm mailman" mailman-join: "|/var/lib/mailman/mail/mailman join mailman" mailman-leave: "|/var/lib/mailman/mail/mailman leave mailman" mailman-owner: "|/var/lib/mailman/mail/mailman owner mailman" mailman-request: "|/var/lib/mailman/mail/mailman request mailman" mailman-subscribe: "|/var/lib/mailman/mail/mailman subscribe mailman" mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman" Hit enter to notify mailman owner... #
We have configured exim to recognize all emails from mailman. So, it's not mandatory to make about entries in /etc/aliases.
If you have made any changes to the configuration files, please ensure to restart those services, before continuing to next section.
Administration
In this section, we assume you have done the default installation. The mailman cgi scripts are still in /usr/lib/cgi-bin/mailman/ directory.
Mailman provides web based administration facility. To access this page, point your browser to the following url:
http://hostname/cgi-bin/mailman/admin
The default mailing list, 'mailman' would appear in this screen. If you click the mailing list name, it would ask for authentication password. If you enter the correct password, you would be able to change administrative settings of this mailing list.
You can create new mailing list using command line utilility (newlist). Alternatively, you can create new mailing list using web interface.
Users
Mailman provides web based interfaces for users. To access this page, point your browser to the following url:
http://hostname/cgi-bin/mailman/listinfo
The default mailing list, 'mailman' would appear in this screen. If you click the mailing list name, it would display the subscription form. You can enter your email address, name (optional) and password to subscribe. An email intimation would be sent to you. You can follow the instructions in the email to subscribe.
References
[http://www.list.org/mailman-install/index.html GNU Mailman - Installation Manual]
[http://www.exim.org/howto/mailman21.html HOWTO - Using Exim 4 and Mailman 2.1 together]
Hope this document is useful. Feedbacks are welcome to bhuvaneswaran at NOSPAM gmail.com.