Subject: Bug#562700: postfix-to-mailman.py does not handle mailman-loop@domain

From: Tobias Diedrich <[email-masked]>
Date: Sun, 27 Dec 2009 06:42:46 +0100

Package: mailman
Version: 1:2.1.11-11
Severity: normal

One of my list admins uses a T-Online account, which rejects spam,
creating a mail loop.
Mailman detects this and tries to send the message to mailman-loop@domain,
which fails because I use postfix-to-mailman.py for the domain and it
doesn't seem to know about mailman-loop.

-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.31.7-nokmem-tomodachi
Locale: LANG=en_IN, LC_CTYPE=en_IN (charmap=UTF-8)
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-18          GNU C Library: Shared libraries
ii  lighttpd [httpd]         1.4.19-5        A fast webserver with minimal memo
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
ii  spamassassin              3.2.5-2+lenny1 Perl-based spam filter using text 

-- debconf information:
* mailman/site_languages: de, en
* mailman/used_languages: de en
* mailman/create_site_list:
* mailman/queue_files_present: continue regardless
* mailman/default_server_language: en
  mailman/gate_news: true

---

From: "Thijs Kinkhorst" <[email-masked]>
Date: Tue, 29 Dec 2009 20:39:45 +0100

> doesn't seem to know about mailman-loop.

Thanks for your report. I am adding '-loop' to the list in
postfix-to-mailman.py under the "# Check for control extension on local
part" comment. Can you confirm that this resolves your problem?

thanks,
Thijs

---

From: Tobias Diedrich <[email-masked]>
Date: Wed, 30 Dec 2009 17:32:23 +0100

> part" comment. Can you confirm that this resolves your problem?

I think it should rather be added to the "# Redirect required
addresses to" since AFAICS it's a global user with no corresponding
mailing list.

-- 
Tobias						PGP: http://8ef7ddba.uguu.de

---

From: Thijs Kinkhorst <[email-masked]>
Date: Wed, 30 Dec 2009 17:55:58 +0100

> addresses to" since AFAICS it's a global user with no corresponding

Actually, I think it is, and that the corresponding mailinglist is the 'site 
list', usually named 'mailman'. This is what I construct from reading the 
code. -loop seems similar in this way to -owner which is also in that same 
spot.

Can you try if adding the suffix to the list I mentioned solves your problem?

thanks,
Thijs

---

From: Tobias Diedrich <[email-masked]>
Date: Wed, 30 Dec 2009 18:57:53 +0100

> Can you try if adding the suffix to the list I mentioned solves your problem?

Sure, this yields the following error message in the end:

<[email-masked]>: Command died with status 6:                  
    "/var/lib/mailman/bin/postfix-to-mailman.py". Command output: Illegal       
    command: loop                                                               

Or if I run /var/lib/mailman/mail/mailman manually:
ari:~# /var/lib/mailman/mail/mailman loop mailman
Illegal command: loop

---

From: Tobias Diedrich <[email-masked]>
Date: Wed, 30 Dec 2009 19:03:50 +0100

> ari:~# /var/lib/mailman/mail/mailman loop mailman

BTW the reason why I assumed it's a special site-wide address is
because the offending message was sent to <somelist> by a
nonsubscriber so was forwarded to <somelist>-admin, bounced there
and then went to mailman-loop (and not <somelist>-loop).

HTH,

---

From: Tobias Diedrich <[email-masked]>
Date: Wed, 30 Dec 2009 19:14:26 +0100

> and then went to mailman-loop (and not <somelist>-loop).

I have to correct myself here a bit after looking at the postmaster
message again:

The 'message needs to be moderated mail' goes to -owner.
mailman expands owner to [email-masked] and sends it with
envelope sender mailman-bounces
t-online bounces and postfix delivers to mailman-bounces
mailman expands mailman-bounces to [email-masked] this time
with envelope sender mailman-loop
t-online bounces and postfix tries to deliver to mailman-loop
mailman-loop is an unknown user

---

From: Thijs Kinkhorst <[email-masked]>
Date: Wed, 30 Dec 2009 22:02:57 +0100

> mailman-loop is an unknown user

I've dug somewhat deeper and it seems that Mailman itself expects this to 
happen with mail to that address (still 'mailman' below is the name of the 
site list):

    # The ultimate loop stopper address
    mailman-loop: /var/lib/mailman/data/owner-bounces.mbox

This is from the aliases file that Mailman generates in its native Postfix 
interface.

As I do not use postfix-to-mailman.py myself I'm open to suggestions on how to 
handle the -loop domain in its context.

cheers,
Thijs

---

From: Tobias Diedrich <[email-masked]>
Date: Thu, 31 Dec 2009 08:40:35 +0100

> handle the -loop domain in its context.

I think the best way would be to delivere it to
mailman-loop@localhost, with an envelope sender of
postmaster@localhost like this (untested, apparently I manged to get
the host onto some (hopefully temporary) t-online blocklist while
testing this...)

    # Redirect mailman-loop special address
    if local in ('mailman-loop'):
        os.execv("/usr/sbin/sendmail",
                 ("/usr/sbin/sendmail", "-f", "postmaster@localhost", "mailman-loop@localhost"))
        sys.exit(0)

HTH,