This is just a very fast and rough simple guideline for setting up Mailman + Exim4 based on Debian etch. For sure that we will also configure Apache2 for Mailman web interface. Not much detail will be mentioned, please refer to corresponding document if you hope to understand more. Debian also come with a handy guideline from /usr/share/doc/mailman/README.Exim4.Debian, so you should have a look with it before follow this guideline :)
Install required packages
You may need something else but I am not sure right now. Please correct me if package missed:
apt-get update
apt-get install mailman exim4-daemon-heavy libapache2-mod-php5Configure Mailman
Since I am not going to support virtual domain with Mailman, I will skip some step which listed in /usr/share/doc/mailman/README.Exim4.Debian. BTW, I would like to change the default web interface URL pattern so let's take the following changes in /etc/mailman/mm_cfg.py:
#-------------------------------------------------------------
# The name of the list Mailman uses to send password reminders
# and similar. Don't change if you want mailman-owner to be
# a valid local part.
MAILMAN_SITE_LIST = 'mailman'
#-------------------------------------------------------------
# If you change these, you have to configure your http server
# accordingly (Alias and ScriptAlias directives in most httpds)
DEFAULT_URL_PATTERN = 'http://%s/mailman/'
PRIVATE_ARCHIVE_URL = '/mailman/private'
IMAGE_LOGOS = '/images/mailman/'
#-------------------------------------------------------------
# Default domain for email addresses of newly created MLs
DEFAULT_EMAIL_HOST = 'example.com'
#-------------------------------------------------------------
# Default host for web interface of newly created MLs
DEFAULT_URL_HOST = 'lists.example.com'I would like to activate SpamAssassin, too. So let's uncomment as below:
#-------------------------------------------------------------
# Uncomment if you want to filter mail with SpamAssassin. For
# more information please visit this website:
# http://www.daa.com.au/~james/articles/mailman-spamassassin/
GLOBAL_PIPELINE.insert(1, 'SpamAssassin')
For sure that, you will need to have a SpamAssassin which setup correctly :)
Next, setup Mailman site password and list creator password with following command:
mmsitepass
mmsitepass -cCreate the system list for mailman:
newlist mailmanConfigure Apache2
Since we change the DEFAULT_URL_PATTERN in mailman configuration, we will also need to update Apache2 to handle it. Create a file call /etc/apache2/conf.d/mailman with following lines:
ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/
Alias /pipermail/ /var/lib/mailman/archives/public/
Alias /images/mailman/ /usr/share/images/mailman/Another solution from
/usr/share/doc/mailman/README.Debian:
An example Apache configuration is included in /etc/mailman/apache.conf.
It can be copied to or symlinked from e.g. the /etc/apache2/conf.d/ directory.
So we can symlink the example file with:
ln -s /etc/mailman/apache.conf /etc/apache2/conf.d/mailman
And edit the head of/etc/apache2/conf.d/mailmanas below:
# We can find mailman here:
ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/
# And the public archives:
Alias /pipermail/ /var/lib/mailman/archives/public/
# Logos:
Alias /images/mailman/ /usr/share/images/mailman/
Configure Exim4
Put this in your exim4 main configuration (e.g. /etc/exim4/exim4.conf.template for unsplit configure, or files located in /etc/exim4/conf.d/*/ for split handling):
# Home dir for your Mailman installation -- aka Mailman's prefix
# directory.
MAILMAN_HOME=/var/lib/mailman
MAILMAN_WRAP=MAILMAN_HOME/mail/mailman
# User and group for Mailman, should match your --with-mail-gid
# switch to Mailman's configure script.
MAILMAN_USER=list
MAILMAN_GROUP=daemonPut this in your exim4 router configuration:
# Messages get sent out with
# envelope from "mailman-bounces@virtual_domain"
# But mailman doesn't put such addresses
# in the aliases. Recognise these here.
mailman_workaround:
domains = +local_domains
require_files = MAILMAN_HOME/lists/$local_part/config.pck
driver = accept
local_parts = mailman
local_part_suffix_optional
local_part_suffix = -bounces : -bounces+* : \
-confirm+* : -join : -leave : \
-subscribe : -unsubscribe : \
-owner : -request : -admin
transport = mailman_transport
group = MAILMAN_GROUP
# Mailman lists
mailman_router:
domains = +local_domains
require_files = MAILMAN_HOME/lists/$local_part/config.pck
driver = accept
local_part_suffix_optional
local_part_suffix = -bounces : -bounces+* : \
-confirm+* : -join : -leave : \
-subscribe : -unsubscribe : \
-owner : -request : -admin
transport = mailman_transport
group = MAILMAN_GROUPPut this in your exim4 transport configuration:
mailman_transport:
driver = pipe
command = MAILMAN_WRAP \
'${if def:local_part_suffix \
{${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
{post}}' \
$local_part
current_directory = MAILMAN_HOME
home_directory = MAILMAN_HOME
user = MAILMAN_USER
group = MAILMAN_GROUP
freeze_exec_fail = trueWe don't need the line below, remember to remove it:
condition = ${lookup{$local_part@$domain}lsearch{MAILMAN_HOME/data/virtual-mailman}{1}{0}}
Save all your settings, and reactive your new Exim4 configuration with:
dpkg-reconfigure exim4-configPost-install configuration
Up to this part, all of your service should configure correctly. So let's restart all related services for activation:
/etc/init.d/apache2 restart
/etc/init.d/exim4 restart
/etc/init.d/mailman restartIn order to protect your system list:
- log into mailing list
mailmanfrom http://lists.example.com/mailman/admin/mailman - change the following setting in
General Options:The public name of this list.: mailmanThe list administrator email addresses.: postmaster@example.comPrefix for subject line of list postings.: [mailman]Host name this list prefers for email.: example.com
- change the following setting in
Privacy options -> Subscription rules:Advertise this list when people ask what lists are on this machine?: NoWho can view subscription list?: List members
- change the following setting in
Archiving Options:Is archive file source for public or private archival?: private
I will assume you know how to create your new list. If you don't know, please refer to my other article for more detail :)
Useful references
- Common Mailman administrative tasks
- 4.06 How can I backup my Mailman lists-membership-etc on a regular basis?


















Post new comment