Mailing Lists Management in Savannah

All gnu and nongnu mailing lists are processed on lists.gnu.org using the Mailman package. This machine is managed by FSF admins. Savannah admins have only non-root access and are able to perform limited mailing-list related administration tasks.

This page describes the interface between Savannah PHP frontend and the Mailman package running on lists.gnu.org. See also:

  • MailSystem - various email and mailing-list related details in Savannah and gnu systems.
  • ListServer - manually running mailing-list related commands.

Overview

Savannah provides mailing lists to hosted groups. Group admins can create as many mailing lists as needed through the web frontend.

The general workflow is as follows:

  1. A group admin on Savannah creates a new mailing list on Savannah website.
  2. The PHP frontend code runs savannah_wrapper.pl on list@lists.gnu.org via ssh; savannah_wrapper.pl runs appropriate Mailman scripts.
  3. The PHP frontend code updates the mailing list information in the mail_group_list table in the savane MySQL database and sends a notification with new mailing list password.

Database

The mail_group_list table contains the following fields:

mysql> select * from mail_group_list where list_name = 'sed-devel' \G
*************************** 1. row ***************************
group_list_id: 3272
     group_id: 6711
    list_name: sed-devel
    is_public: 1
     password: NULL
   list_admin: 829
       status: 5
  description: Development discussion for GNU Sed

To see the mailing lists for a Savannah group:

mysql> select list_name from mail_group_list,groups
       where groups.unix_group_name = 'coreutils'
       and groups.group_id = mail_group_list.group_id ;
+---------------+
| list_name     |
+---------------+
| bug-coreutils |
| coreutils     |
+---------------+
2 rows in set (0.00 sec)

The meaning of the status field:

Status 0: obsolete.
Status 1: obsolete.
Status 2: obsolete.
Status 5: the only one used, so actually means nothing.

The password field means: nothing.

savannah_wrapper.pl

This script processes requests from frontend and translates them in Mailman script invocations. The requests are read from STDIN as a set of lines in form

VAR=VALUE

The response is written to STDOUT; normal output looks like a similar set of

VAR=VALUE

It includes the version of the script and the variables set in the process. Errors, if any, are reported in lines starting with 'Error', typically without the '=' sign.

The COMMAND variable is required, it may have values:

version: Report version and generated password and quit.
newlist: Create a list.  The parameters used are
  VISIBILITY, LIST_FULL_NAME, DESCRIPTION, ADMIN_MAIL, PASSWORD
  (all are required).
config: Make list public or private, change its description.
  Used parameters are VISIBILITY and DESCRIPTION (both optional).
change_pw: Request password reset. The parameters used are
  LIST_NAME and PASSWORD (both required).
rmlist: Remove the list. The parameter used is LIST_NAME (required).

The parameters used by commands are

DRY_RUN: Don't apply changes; the only valid value is 'yes'.
ADMIN_MAIL: Email of the administrator.
LIST_NAME: List name, e.g. pretest-users.
LIST_FULL_NAME: List name with domain, e.g. pretest-users@lists.nongnu.org.
DESCRIPTION: A line describing the list
PASSWORD: New password; when empty (which is the normal usage),
  the script generates a new password.
VISIBILITY: Whether the list is 'public' or 'private'.

Manual walk-through example - changing description

The frontend code connects to lists.gnu.org and transmits the commands as STDIN. Equivalent command (still on frontend):

# sudo -u www-data ssh -T list@lists.gnu.org <<EOF
COMMAND=config
LIST_FULL_NAME=pretest-users@lists.nongnu.org
DESCRIPTION=Test mailing list
EOF
version=list@lists.gnu.org 0.1
command=config
list_full_name=pretest-users@lists.nongnu.org
description=Test mailing list

The script savannah_wrapper.pl on lists.gnu.org reads the commands from STDIN and executes the needed programs.

Equivalent command (on lists.gnu.org):

$ ssh list@list.gnu.org
lists:~$ echo description='Test mailing list' \
  | config_list -i /dev/stdin pretest-users

Mailing list creation - FOR REFERENCE ONLY

The Following section describes the original setup. It is kept for historical purposes

I (Sylvain) basically installed sv_mailman on internal.sv.gnu.org, modified it to support mailman virtual hosts (and use the proper admin mail instead of username@sv.gnu.org). Then I wrote a fake /usr/sbin/newlist that connects to list@lists.gnu.org via SSH and call an helper script there (savannah_wrapper.pl). This happens via a Savannah public key in list@lists.gnu.org authorized_keys with a command= restriction.

There is also an empty /usr/sbin/config_list on internal that does nothing; we don't want what Savane currently does there.

The cron job runs on internal every five minutes, file /etc/cron.d/sv. The script being run is named sv_mailman.

On lists.gnu.org, there is a script mycreate_list.pl which can be used to create lists by hand. It duplicates what savannah_wrapper.pl does for Savannah actions. (The scripts must be kept in sync by hand. They should be merged so there is only one.)