ezmlm - An old and outdated HOWTO by example

Since the time this pages were written a lot more contributions to ezmlm has been made. Especially the newer versions of ezmlm-idx completely cover all topics mentioned here. Also, there is a very good documentation available, which describes the procedure of creating a broad band of list types in detail. Please take a look at it. In the meantime, I will change the topic of this pages...

Written by Özgür Kesim
Created: Tue Aug 19 08:47:30 MET DST 1997
Updated: Fri Sep 28 09:32:35 CEST 2007


Consider this page as a HOWTO for setting up advanced mailing lists using ezmlm. This collects my experiences with ezmlm.

I assume, that you already read the ezmlm documentation. I will not explain the basic steps.

You must use qmail (v1.01) as your MTU and have ezmlm v0.53 installed.
Important: You will also need the ezmlm-issub program and ezmlm-idx (v0.10) extension for ezmlm.
qmail is available at

ftp://ftp.qmail.org/pub/software

ezmlm-idx-0.10 and ezmlm-issub are available at

ftp://ftp.id.wustl.edu/pub/patches/

I give an overview about the neccessary steps for running a whole family of mailing lists. As an example, I'll explain the vim mailing list family I created at babayaga.math.fu-berlin.de.
Note: I use fixed font for listnames, keywords, sripts, filenames and directories.
The pattern /home/vim/{foo,bar} stands for the list /home/vim/foo /home/vim/bar

The mailing lists family design

Consider the following situation:
You have an access to an account as vim at machine a.b.c.
You which to setup five mailinglists, lets give them a name:
vim-announce@a.b.c
This is intended for those who only want to be notified upon new versions

vim@a.b.c
This is for users of vim

vim-dev@a.b.c
This is about development on vim

vim-digest@a.b.c
This is a digest list, sending a weekly digest (the mails in vim@a.b.c) to its members

vim-dev-digest@a.b.c
As vim-digest, but sending the last weeks contents of vim-dev@a.b.c

At this point, we formulate the following conditions:

  1. Mails to vim-announce should be forwarded to vim and vim-dev
  2. No one except the maintainer should be able to post to vim-announce
  3. Only subscribers to vim (resp. vim-dev) can post to vim (resp. vim-dev)
  4. The digest lists only handle (un)subscriptions, creating the digest and sending them. No postings allowed.

Setting the whole stuff up

First of all, we simply create each list using the ezmlm-make command. For the later proceeding, make sure that you had ezmlm compiled together with ezmlm-issub and ezmlm-idx.
I assume the lists are located at /home/vim/{vim,announce,dev,vim-digest,dev-digest}

vim-announce fowarding

For this we have to change the /home/vim/announce/editor file. Originally it looks like
| /usr/local/bin/ezmlm/ezmlm-reject
| /usr/local/bin/ezmlm/ezmlm-send '/home/vim/announce'
| /usr/local/bin/ezmlm/ezmlm-warn '/home/vim/announce' || exit 0
If we change this to
| /usr/local/bin/ezmlm/ezmlm-reject
| /usr/local/bin/ezmlm/ezmlm-send '/home/vim/announce'
| /usr/local/bin/ezmlm/ezmlm-send '/home/vim/dev'
| /usr/local/bin/ezmlm/ezmlm-send '/home/vim/vim'
| /usr/local/bin/ezmlm/ezmlm-warn '/home/vim/announce' || exit 0
ezmlm automatically sends each mail sent to announce also to the other two.

Permissions to mail to vim-announce

Now, we wish to restrict the permission to mail to this list. The easiest way is to only allow those mails, which contain a special (and secret) header entry, which f.e. is only known to the maintainer.

We choose X-Secret-Code: 1234 as this header entry. Now we change /home/vim/announce/editor to

|grep "^X-Secret-Code: 1234" || ( echo "You are not allowed to post to this list"; exit 100 )
| /usr/local/bin/ezmlm/ezmlm-reject
| /usr/local/bin/ezmlm/ezmlm-send '/home/vim/announce'
| /usr/local/bin/ezmlm/ezmlm-send '/home/vim/dev'
| /usr/local/bin/ezmlm/ezmlm-send '/home/vim/vim'
| /usr/local/bin/ezmlm/ezmlm-warn '/home/vim/announce' || exit 0

Note:
Make sure, that your grep-command exits with the proper exit-code.
Instead of the echo command, you may use a script which writes a more detailed failure notice. But make shure, that you exit with code 100 in order to force ezmlm to stop further processing of the editor-file and sending a error message back to the sender.

Since we don't want the "X-Secret-Code" send to all members, we have to remove this headerfield. This is done by edditing *every* headerremove file in the directories /home/vim/{vim,announce,dev} and adding x-secret-code in a separate line.

Permissions to vim and vim-dev

First, we consider the case, where we restrict mails to vim (resp. vim-dev) to those which come from a member of vim (resp. vim-dev).

An other case would be, to allow members of the vim list to mail also to vim-dev and vice versa. This case is easy to reflect, if you understand the other case.

Note:
We only describe the steps for the vim list. You have to apply the same changes to vim-dev, too (use the appropriate filename).
Here we need the ezmlm-issub command.

We put the following line as the first line into /home/vim/vim/editor


|/usr/local/bin/ezmlm/ezmlm-issub '/home/vim/vim' "$SENDER" || ( echo "You are not allowed to post to this list"; exit 100 )

Again, you may use a script for more detailed output, which exists with code 100

Setting up the digest lists

We only explain the steps for vim-digest.
Note:
Here we use, that you had compiled ezmlm with ezmlm-idx (v0.10).

Let me explain the strategy:
You must know, that the vim list itself is responsable for creating the digest. Such a digest can be requested by sending a email to vim-dig.[COOKIE]. Therefore everyone who knows this [COOKIE] can request a digest.

We use cron to execute weekly (or whenever you wish to send the digest) a job, which sends such an digest-request to the vim list. The sender will be the vim-digest list itself. Therefore, the digest will then be sent to the digest list and then be forwarded to all it members.

First, we must enable such requests and protect them with a [COOKIE]. For this, simply edit the /home/vim/vim/manager file and change the first line to

|/usr/local/bin/ezmlm/ezmlm-get '/home/vim/vim' [COOKIE]
that is, simply add [COOKIE] to the first line.

To avoid others to be able to send mails to the digest list, we declare vim-digest to be a sublist of vim by executing the following command:
echo "vim@a.b.c" > /home/vim/vim-digest/sublist
This is for the following reasons:

  • If a mail to vim-digest arives, ezmlm will insist, that the sender is vim@a.b.c.
  • ezmlm will not put a Mailing-List field into the header.
Therefore, we avoid postings to vim-digest other then from the vim list.
You may add
Reply-To: vim@a.b.c
to the /home/vim/vim-digest/headeradd file to give mailing software a hint, where a reply has to go to.

Now, setup a crontab entry (for user vim), running crontab -e and write something like:

0 23 * * 7   echo -e "To: vim-dig.[COOKIE]@a.b.c\n" | /var/qmail/bin/qmail-inject -fvim-digest@a.b.c
On Sundays at 11pm, the digest will be created and then sent to the members of the digest list.

Voilá. That's all.