Posted by Steve on Wed 9 Mar 2005 at 16:11
Mailing lists are good for achiving discussion when you have no idea in advance how many people might be interested - because there's no real limit to the number of members. They're also good for preserving history as the messages can be archived easily and made searchable on the web.
Whilst there are many mailing list managers available inside Debian one of the most popular is GNU Mailman, it is used for many mailing lists around the world and it is well suited for use with the mail transfer agent used in Debian, exim or exim4 by default.
One of the attractions of using mailman is that it offers a simple means to archive the messages built in, these can be placed upon the internet easily and automatically if your mailing list server is running a webserver.
To install mailman you should run, as root:
apt-get install mailman
This will download and install the package and any missing dependencies for you.
Installing On Debian's Unstable or Testing branchesWhen you install on the Unstable or Testing branch of Debian you will install a more recent version than that which is included in Debian's Woody release. Because of that the installation is not complete until you perform a couple of additional steps.
When the package installs it will ask you to choose the languages it should enable. You can merely accept the default of en if you're not discussing things in additional languages, this is the default.
You'll also be prompted to create a mailman specific list, do that by following the instructions given to you, run the following command:
newlist mailmanAnswer the questions it asks you and when it is finished it will give you this output:
## 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"These lines should be added to the end of the system alias file you have /etc/alias. Once you've added them you should run the following command to regenerate the binary aliases file:
newaliasesFinally you need to start the mailman daemon, you do that by running:
/etc/init.d/mailman startOnce these things have been done the software is installed as it would have been under Woody, and you can now follow on as normal.
The next step is to configure the mailing lists you wish to use, and make sure they are archived to the internet. Both of these things are simple to arrange.
To create new mailing lists there are two steps:
To start the process lets imagine we're going to create a new mailing list to discuss sheep, run the following command to setup mailman for the list:
newlist sheep
This will create a bunch of mail aliases and output them for you - to hook them up to your mail delivery agent you must add them to the system aliases file, /etc/aliases.
The lines generated will look like this:
## sheep mailing list sheep: "|/var/lib/mailman/mail/mailman post sheep" sheep-admin: "|/var/lib/mailman/mail/mailman admin sheep" sheep-bounces: "|/var/lib/mailman/mail/mailman bounces sheep" sheep-confirm: "|/var/lib/mailman/mail/mailman confirm sheep" sheep-join: "|/var/lib/mailman/mail/mailman join sheep" sheep-leave: "|/var/lib/mailman/mail/mailman leave sheep" sheep-owner: "|/var/lib/mailman/mail/mailman owner sheep" sheep-request: "|/var/lib/mailman/mail/mailman request sheep" sheep-subscribe: "|/var/lib/mailman/mail/mailman subscribe sheep" sheep-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe sheep"
These lines are in a fairly simple format, the thing to the left of the ":" seperator are addresses, eg "sheep@yourdomain.com", "sheep-subscribe@yourdomain.com". The bit after the colon is a program to run when a mail is sent to that address.
To make the alias changes live you must regenerate the file by running:
newaliases
This should be sufficient to wire up your new mailing list.
To test it you should try sending a mail to "sheep@yourdoamin.com", if all goes well you will not recieve an error and people on the list (none yet!) will all receive a copy.
If this proceeded without error you can now make sure that your mail is being archived correctly. Mailman will integrate itself into your webserver if you're running Apache or Apache2
For example you can view the mailing list page that describes your new sheep list by visiting the following URL:
http://example.com/cgi-bin/mailman/listinfo/sheep
The archives will not be setup properly yet, to do that you should add the following two lines to the bottom of your apache configuration file:
Alias /pipermail/ /var/lib/mailman/archives/public/ Alias /images/mailman/ /usr/share/images/mailman/
Once you do that and restart your webserver you can view the archive pages for your new list by visiting the following URL:
http://example.com/pipermail/sheep/
Users can add and remove themselves to the list by visiting the webpages and entering their email address, or by sending a message to the addresses:
sheep-subscribe@example.com # Add themselves sheep-unsubscribe@example.com # Remove themselves
This article can be found online at the Debian Administration website at the following bookmarkable URL:
This article is copyright 2005 Steve - please ask for permission to republish or translate.