tonioo/modoboa — pull request #8 by lddubeau (2013-09-07 20:45:12+00:00)
Title: Feature: score and sorting in quarantine

I don't think this is quite ready to pull yet but I don't see a way to get a discussion going about this without putting in a pull request.

I've reimplemented Quarantine on the basis of Listing. There was no inherent obstacle to doing so but the lack of code documentation made the task more difficult than it could have been. I use jsdoc3 for my own needs. Here's an [example](https://github.com/mangalam-research/wed/blob/master/lib/wed/tree_updater.js).

I've rebased my branch on the latest state of master but I've tested it on my own live modoboa installation by diffing the head of the branch against its base and applying this patch onto 1.0.0.

I've not bothered with pep8 because I'd rather focus on functionality rather than cosmetics for now.

I've noticed a problem but I think it is a preexisting architectural problem that my code revealed rather than a problem I've created. If I sort on spam score or date in the quarantine and then navigate to the webmail page, I get a error message that suggests that modoboa is trying to apply the sort I've selected in quarantine to the webmail window. The error is:

UID command error: BAD ['Error in IMAP command UID SORT: Unknown sort argument: SCORE']

It looks like `request.session["navparams"]` is shared by the two extensions. I'm not sure what the fix is here. Is there anything that should be shared at all between the two?