[Pkg-mailman-hackers] Bug#570548: mailman: postfix-to-mailman.py doesn't work with lists ending in -admin

Axel Beckert beckert at phys.ethz.ch
Fri Feb 19 18:42:02 UTC 2010


Package: mailman
Version: 1:2.1.11-11, 1:2.1.13-1
Severity: normal
File: /usr/share/mailman/postfix-to-mailman.py
Tags: patch, lenny

After I migrated a list server from the classic
/var/lib/mailman/data/aliases file to postfix-to-mailman.py, two out
of 180 mailing lists stopped working: itp-admin and phys-admin.

Reason is the parsing of local part in postfix-to-mailman.py:

postfix-to-mailman.py first checks if the given local part of a
recipient address ends in some specific values and removes them, and
then checks if the mailing list exists. This fails with "user unknown"
if mail is sent to a mailing list ending in one of these values.

Not all of these values are practicable for mailing list names, but at
least "-admin" (and maybe "-join") are and they are used as my example
above shows.

The following patch fixes this behaviour by _first_ checking if a
mailing list named with the full local part exists, and only if not,
tries to parse an administrative suffix out of the local part and then
checks for the existance of the mailing list again.

diff -u postfix-to-mailman.py.orig postfix-to-mailman.py
--- postfix-to-mailman.py.orig  2009-01-26 20:52:35.000000000 +0100
+++ postfix-to-mailman.py       2010-02-19 18:46:36.000000000 +0100
@@ -116,6 +116,14 @@
     # Assume normal posting to a mailing list
     mlist, func = local, 'post'
 
+    # Let Mailman decide if a list exists.
+    from Mailman.Utils import list_exists
+
+    if list_exists(mlist):
+        mm_pgm = os.path.join(paths.prefix, 'mail', 'mailman')
+        os.execv(mm_pgm, (mm_pgm, func, mlist))
+        # NOT REACHED
+
     # Check for control extension on local part
     for ext in ('-admin',
                 '-owner',
@@ -132,8 +140,6 @@
             func  = ext[1:]
             break
 
-    # Let Mailman decide if a list exists.
-    from Mailman.Utils import list_exists
     if list_exists(mlist):
         mm_pgm = os.path.join(paths.prefix, 'mail', 'mailman')
         os.execv(mm_pgm, (mm_pgm, func, mlist))

Discovered the bug in Debian Lenny (and think it should be fixed
there, too), but I also found it in the Mailman version in Sid.

-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-xen-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages mailman depends on:
ii  adduser                  3.110           add and remove users and groups
ii  apache2                  2.2.9-10+lenny6 Apache HTTP Server metapackage
ii  apache2-mpm-prefork [htt 2.2.9-10+lenny6 Apache HTTP Server - traditional n
ii  cron                     3.0pl1-105      management of regular background p
ii  debconf [debconf-2.0]    1.5.24          Debian configuration management sy
ii  libc6                    2.7-18lenny2    GNU C Library: Shared libraries
ii  logrotate                3.7.1-5         Log rotation utility
ii  lsb-base                 3.2-20          Linux Standard Base 3.2 init scrip
ii  postfix [mail-transport- 2.5.5-1.1       High-performance mail transport ag
ii  pwgen                    2.06-1          Automatic Password generation
ii  python                   2.5.2-3         An interactive high-level object-o
ii  python-support           0.8.4lenny1     automated rebuilding support for P
ii  ucf                      3.0016          Update Configuration File: preserv

mailman recommends no packages.

Versions of packages mailman suggests:
pn  listadmin                  <none>        (no description available)
ii  lynx                       2.8.7dev9-2.1 Text-mode WWW Browser (transitiona
pn  spamassassin               <none>        (no description available)

-- debconf information:
  mailman/gate_news: false
  mailman/site_languages: en
  mailman/queue_files_present: abort installation
* mailman/used_languages:
  mailman/default_server_language: en
  mailman/create_site_list:





More information about the Pkg-mailman-hackers mailing list