[Bug 827697] [NEW] Moderating a message with Action.accept does not cause held message to be sent or even removed from pending.

Public bug reported: 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. ** Affects: mailman Importance: Undecided Status: New ** Tags: mailman3 -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/827697 Title: Moderating a message with Action.accept does not cause held message to be sent or even removed from pending. To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/827697/+subscriptions

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: testlist@foo.example.com post from test_email_d@foo.example.com held, message-id=<20110816230124.3048.70109@static.sgoss-centos6-vm>: n/a Aug 16 16:01:28 2011 (3054) held message approved, message-id: <20110816230124.3048.70109@static.sgoss-centos6-vm> Aug 16 16:01:28 2011 (3048) HOLD: testlist@foo.example.com post from test_email_d@foo.example.com held, message-id=<20110816230124.3048.70109@static.sgoss-centos6-vm>: n/a Immediately after being approved, the message is held again. -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/827697 Title: Moderating a message with Action.accept does not cause held message to be sent or even removed from pending. To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/827697/+subscriptions

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. -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/827697 Title: Moderating a message with Action.accept does not cause held message to be sent or even removed from pending. To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/827697/+subscriptions

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. -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/827697 Title: Moderating a message with Action.accept does not cause held message to be sent or even removed from pending. To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/827697/+subscriptions

See if this does the trick. ** Changed in: mailman Status: New => Triaged ** Patch added: "827697.diff" https://bugs.launchpad.net/mailman/+bug/827697/+attachment/2287734/+files/82... -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/827697 Title: Moderating a message with Action.accept does not cause held message to be sent or even removed from pending. To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/827697/+subscriptions

Yes, with that patch, the moderated messages get delivered, my tests go green. -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/827697 Title: Moderating a message with Action.accept does not cause held message to be sent or even removed from pending. To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/827697/+subscriptions

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! -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/827697 Title: Moderating a message with Action.accept does not cause held message to be sent or even removed from pending. To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/827697/+subscriptions

** Changed in: mailman Milestone: None => 3.0.0a8 ** Changed in: mailman Assignee: (unassigned) => Barry Warsaw (barry) ** Changed in: mailman Importance: Undecided => High ** Changed in: mailman Status: Triaged => Fix Committed -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/827697 Title: Moderating a message with Action.accept does not cause held message to be sent or even removed from pending. To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/827697/+subscriptions

** Changed in: mailman Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/827697 Title: Moderating a message with Action.accept does not cause held message to be sent or even removed from pending. To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/827697/+subscriptions
participants (2)
-
Barry Warsaw
-
Stephen A. Goss