Lists with topics enabled can throw unexpected keyword argument 'Delete' exception.

Bug #1251495 reported by Mark Sapiro on 2013-11-15
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GNU Mailman
High
Mark Sapiro
mailman (Ubuntu)
Undecided
Unassigned
Trusty
High
Unassigned

Bug Description

[Impact]

 * Using Mailman Lists with topics enabled can fail due to a typo

 * Fix is trivial and a backport active in everything >Trusty for quite a
   while now

[Test Case]

 * Code approach as it is rather obvious. With packages installed check
   the argument "Delete" vs
   "delete":
# grep -A 2 'change_header(' /usr/lib/mailman/Mailman/Handlers/Tagger.py
        change_header('X-Topics', NLTAB.join(hits.keys()),
                      mlist, msg, msgdata, Delete=False)
# grep -A 2 def /usr/lib/mailman/Mailman/Handlers/CookHeaders.py | grep 'change_header('
def change_header(name, value, mlist, msg, msgdata, delete=True, repl=True):

  * Use-Case approach:
    0. do a basic mailman setup
    1. enable by putting these two lines
      topics_enabled = 1
      topics = [('Match_all', '.', 'Topic matches anything for testing', False)]
      in a file and running Mailman's bin/config_list like:
      $ bin/config_list -i path/to/file/with/lines list_name
    2. Then, a post to that list should be delivered normally and contain
       a header 'X-Topics: Match_all', but the bug will cause the post to
       be shunted.
    X. With the fixed package that no more happens

[Regression Potential]

 * It fixes an obvious broken variable access, but nothing else - so I'd
   consider it safe. I don't think any code reaching this line ever worked
   but if one had a setup awkwardly working while accepting this breakage
   he might now get a different behavior.

[Other Info]

 * embarrassingly old

---

Code added to Tagger.py in 2.1.16 to support the from_is_list Wrap Message option contained a misspelling.

Related branches

Mark Sapiro (msapiro) on 2013-11-15
Changed in mailman:
status: In Progress → Fix Committed
Mark Sapiro (msapiro) on 2013-11-23
Changed in mailman:
status: Fix Committed → Fix Released

Fixed upstream, but needs backport to Trusty - all other releases are already including the fix.

The diff this is about is:
@@ -71,7 +73,7 @@
     if hits:
         msgdata['topichits'] = hits.keys()
         change_header('X-Topics', NLTAB.join(hits.keys()),
- mlist, msg, msgdata, Delete=False)
+ mlist, msg, msgdata, delete=False)

Changed in mailman (Ubuntu):
status: New → Fix Released
Changed in mailman (Ubuntu Trusty):
status: New → Triaged
importance: Undecided → Medium
importance: Medium → High

FYI - it was reported that: "This is a high importance bug that can cause email to "disappear" since Mailman gets an exception and just puts the email into the shunt directory."

by Phillip Colmer

It feels I'm the only one coming by to clean every now and then - feels bad :-/
The change was revno: 1433

For the sake of any progress I made a ppa with the fix available at [1].

I thought lacking the experience to set it up correctly I can't drive a SRU [2]
But actually, this is easy enough just by looking at the code:

That should be enough I'd think:
$ grep -A 2 'change_header(' Mailman/Handlers/Tagger.py; grep -A 2 def Mailman/Handlers/CookHeaders.py | grep 'change_header('
        change_header('X-Topics', NLTAB.join(hits.keys()),
                      mlist, msg, msgdata, Delete=False)
def change_header(name, value, mlist, msg, msgdata, delete=True, repl=True):

@Mark - if you have not given up on this bug, if you can provide a "steps to reproduce" please feel free to add.

[1]: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/3011
[2]: https://wiki.ubuntu.com/StableReleaseUpdates

description: updated

I think the fix is obvious, but the case a bit special without (me) knowing how to reproduce. So an MP for review comments is up at [1] to gain more confidence before uploading for an SRU.

[1]: https://code.launchpad.net/~paelzer/ubuntu/+source/mailman/+git/mailman/+merge/332798

Mark Sapiro (msapiro) wrote :

To reproduce the error you need to enable topics for a list, create a topic and send a post that matches that topic.

You can do the enable/create by putting these two lines

topics_enabled = 1
topics = [('Match_all', '.', 'Topic matches anything for testing', False)]

in a file and running Mailman's bin/config_list like

bin/config_list -i path/to/file/with/lines list_name

Then, a post to that list should be delivered normally and contain a header 'X-Topics: Match_all', but the bug will cause the post to be shunted.

description: updated

Got an ack on the MP and pushed the fix to Trusty as SRU.
Somewhat sad but better late than never.

Hello Mark, or anyone else affected,

Accepted mailman into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mailman/1:2.1.16-2ubuntu0.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-trusty to verification-done-trusty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-trusty. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in mailman (Ubuntu Trusty):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-trusty
Philip Colmer (philip-colmer) wrote :

I have tested 2.1.16 on trusty and I can confirm that it replaces "Delete=False" with "delete=False" in /var/lib/mailman/Mailman/Handlers/Tagger.py.

Also chacked the same, thanks Phillip!
Setting verified.

tags: added: verification-done verification-done-trusty
removed: verification-needed verification-needed-trusty
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mailman - 1:2.1.16-2ubuntu0.3

---------------
mailman (1:2.1.16-2ubuntu0.3) trusty; urgency=medium

  * Fixed a misspelling in Tagger.py that breaks Lists
    with topics enabled (LP: #1251495)

 -- Christian Ehrhardt <email address hidden> Wed, 25 Oct 2017 16:46:47 +0200

Changed in mailman (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for mailman has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers