This guide explains how to setup Mailman mailing list software with the Apache web server and Postfix mail servers on Ubuntu with running ispconfig3. The intended audience is experienced linux users and system administrators.
Assumptions
- It is assumed that you know how to run linux commands, edit files, and start and stop services in the linux system. It is also assumed that you have administrative access to an Ubuntu system, that you have internet connection and that you have configured /etc/apt/sources.list.
- myhostname : masterpop3.domain.com
- sign ‘~#’ is mean your console
1. Installation Mailman
~# aptitude install mailman
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following NEW packages will be installed:
mailman pwgen{a}
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,665kB of archives. After unpacking 45.0MB will be used.
Do you want to continue? [Y/n/?] y
2. Apache Configuration
An example Apache configuration file comes with Mailman and is placed in /etc/mailman/apache.conf. In order for Apache to use the config file it needs to be copied to /etc/apache2/conf.d, just create symlink :
~# ln -s /etc/mailman/apache.conf /etc/apache2/conf.d/mailman
This will setup a new Apache VirtualHost for the Mailman administration site. Once you have created the symbolic link, you’ll need to enable it and restart Apache:
~# /etc/init.d/apache2 restart
3. Integration Postfix & Mailman
Ensure that the following line exist:
~# vim /etc/postfix/main.cf owner_request_special = no mailman_destination_recipient_limit = 1
Postfix 2.0 supports “virtual alias domains”, essentially what used to be called “Postfix-style virtual domains” in earlier Postfix versions. To make virtual alias domains work with Mailman, you need to do some setup in both Postfix and Mailman. Mailman will write all virtual alias mappings to a file called, by default, /usr/local/mailman/data/virtual-mailman. It will also use postmap to create the virtual-mailman.db file that Postfix will actually use.
First, you need to set up the Postfix virtual alias domains as described in the Postfix documentation (see Postfix’s virtual(5) manpage). Note that it’s your responsibility to include the virtual-alias.domain anything line as described manpage; Mailman will not include this line in virtual-mailman. You are highly encouraged to make sure your virtual alias domains are working properly before integrating with Mailman.
Next, add a path to Postfix’s virtual_alias_maps variable, pointing to the virtual-mailman file.
Ensure that the following line exist at file /etc/postfix/main.cf:
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman
assuming you’ve installed Mailman in the default location. If you’re using an older version of Postfix which doesn’t have the virtual_alias_maps variable, use the virtual_maps variable instead.
~# vim /etc/mailman/mm_cfg.py
The MTA variable names a module in the Mailman/MTA directory which contains the mail server-specific functions to be executed when a list is created or removed.
MTA='Postfix'
Next, in your mm_cfg.py file, you will want to set the variable POSTFIX_STYLE_VIRTUAL_DOMAINS to the list of virtual domains that Mailman should update. This may not be all of the virtual alias domains that your Postfix installation supports! The values in this list will be matched against the host_name attribute of mailing lists objects, and must be an exact match.
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['masterpop3.domain.com','domain2.com']
Now, any list that Mailman creates in either of those two domains, will have the correct entries written to /usr/local/mailman/data/virtual-mailman.
As above with the data/aliases* files, you want to make sure that both data/virtual-mailman and data/virtual-mailman.db are user and group owned by mailman.
4. Mailman Configuration
first check aliases
~# cd /var/lib/mailman ~# ls -l data/ total 52 -rw-rw-r-- 1 root list 10 2010-05-17 21:53 last_mailman_version -rw-r--r-- 1 root list 14100 2010-01-18 15:29 sitelist.cfg
Check list (make sure only)
~# list_lists No matching mailing lists found
create new list (Please create it; until then, mailman will refuse to start.)
~# newlist mailman Enter the email of the person running the list: wawan at masterpop3.domain.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...
Make sure new list has been created.
~# list_lists 1 matching mailing lists found: Mailman - [no description available]
finaly make sure mailman have aliases files :
~# cd /var/lib/mailman ~# ls -l data/ -rw-rw---- 1 root list 1132 2010-05-17 22:55 aliases -rw-r----- 1 root list 12288 2010-05-17 22:55 aliases.db -rw-rw-r-- 1 root list 10 2010-05-17 21:53 last_mailman_version -rw-r--r-- 1 root list 14100 2010-01-18 15:29 sitelist.cfg -rw-rw---- 1 root list 1121 2010-05-17 22:55 virtual-mailman -rw-r----- 1 root list 12288 2010-05-17 22:55 virtual-mailman.db
make surce ones again to generate aliases :
Run the bin/genaliases script to initialize your aliases file.
~# cd /var/lib/mailman ~# bin/genaliases
check your mailman installation (check permission file) :
~# cd /usr/lib/mailman ~# bin/check_perms
if there are errors, type :
~# bin/check_perms –f
Starting your mailman :
~# /etc/init.d/apache2 restart ~# /etc/init.d/postfix restart ~# /etc/init.d/mailman restart
5. Web 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://masterpop3.domain.com/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.
For each list, you have three web sections:
- http://masterpop3.domain.com/cgi-bin/mailman/admin/list: admin interface for the list list.
- http://masterpop3.domain.com/cgi-bin/mailman/listinfo/list: user interface for the list list.
- http://masterpop3.domain.com/cgi-bin/mailman/admindb/list: pending messages waiting for approval.
6. Command line interface
Mailman also have a set of command line tools. Here are the most important:
- newlist: add a new list
- rmlist ”list”: delete a list
- list_lists: list all the lists
- list_members ”list”: list all the members of the list
- add_members ”user@example.com” ”list”: add e-mail user@example.com to the list list.
- remove_members ”user@example.com” ”list”: remove e-mail user@example.com to the list list
- mmsitepass: define a site password to access administration web interfaces
7. 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.
8. References
- GNU Mailman – installation manual
- Mailman – Community Ubuntu Documentation
- Mailman Configuration in Debian
Hope this document is useful.
—- Good Luck —-
wawan bahtiar aka masterpop3
Tags: ispconfig3, lucid, mailman, posfix, ubuntu 1,174 views

