Moderating a message with Action.accept does not cause held message to be sent or even removed from pending.

Bug #827697 reported by Stephen A. Goss on 2011-08-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Mailman
High
Barry Warsaw

Bug Description

I'm building a REST API for moderation. Calling moderator.handle_message with Action.discard and Action.reject seem to do the right thing, but calling it with Action.accept doesn't seem to. Instead the held message stays in the pending queue and nothing is delivered to the list.

I thought it was related to this: https://bugs.launchpad.net/mailman/+bug/827547

But I get the same result whether or not that error message appears in the logs.

Stephen A. Goss (postfuturist) wrote :

The message does appear to leave the pending queue, but I think it immediately goes back into the queue after being "accepted".

notice the sequence of events in the vette.log:

Aug 16 16:01:24 2011 (3048) HOLD: <email address hidden> post from <email address hidden> held, message-id=<email address hidden>: n/a
Aug 16 16:01:28 2011 (3054) held message approved, message-id: <email address hidden>
Aug 16 16:01:28 2011 (3048) HOLD: <email address hidden> post from <email address hidden> held, message-id=<email address hidden>: n/a

Immediately after being approved, the message is held again.

Stephen A. Goss (postfuturist) wrote :

In the above vette.log, (3048) is the IncomingRunner and (3054) is the REST service. The reason the REST service is approving the message is because of my in-progress REST API for moderation.

Barry Warsaw (barry) wrote :

I'm almost positive none of the built-in chain's rules are checking msgdata['approved'] or msgdata['moderator_approved'] and jumping to the accept chain. So when handle_message() dumps the message back into the 'in' queue, it just runs through the rules and hits the same hold criteria as before.

I have to think about the right way to fix this. One way is to add a rule that just checks one of those metadata keys and then jumps to the accept chain. That'd be the easy way to solve this. OTOH, once a message has been accepted by the moderator, it doesn't make much sense to run through the built-in chain again. I don't know whether that means the message should go straight to the pipeline queue instead of the incoming queue, or whether it should go to the incoming queue with a custom chain. However, there's currently no way to specify a different chain for a message to run through (i.e. via some metadata key).

I'll have to think on this one a bit.

Barry Warsaw (barry) wrote :

See if this does the trick.

Changed in mailman:
status: New → Triaged
Stephen A. Goss (postfuturist) wrote :

Yes, with that patch, the moderated messages get delivered, my tests go green.

On Aug 18, 2011, at 04:36 PM, Stephen A. Goss wrote:

>Yes, with that patch, the moderated messages get delivered, my tests go
>green.

Cool. Now I just have to write my own test for this change!

Barry Warsaw (barry) on 2011-08-22
Changed in mailman:
milestone: none → 3.0.0a8
assignee: nobody → Barry Warsaw (barry)
importance: Undecided → High
status: Triaged → Fix Committed
Barry Warsaw (barry) on 2011-09-25
Changed in mailman:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers