[Users] Sort by thread length?

Milan Obuch claws-mail-users at dino.sk
Sun Jun 12 15:16:17 CET 2022


On Thu, 12 May 2022 17:41:12 +0100
MJ Ray <mjr at phonecoop.coop> wrote:

> Does anyone know a way to sort a mailbox display by thread length,
> please?
> 
> I'd like to make it easier for me to spot lone requests that haven't
> got bogged down in long discussions. Searching for mails with empty
> in-reply-to header doesn't cut it because that finds the head mail of
> every thread.
> 
> Scoring replies up and then sorting by score doesn't work because
> sorting thread views only looks at the score of the first mail, rather
> than the total of the thread. I don't see how to make an email be
> sorted by the sum of its replies' scores, which could help.
> 

Hi,

as there were no replies here, I think it is not an easy task. In my
oppinion, it is suitable for some scripting. As I created Lua scripting
plugin for Claws Mail, I'll illustrate its use. I consider this
approach more efficient than shell scripting and similar for this task.

This brings first drawback with itself - currently this plugin is not
part of official sources, you need patched sources and compile
everything from sources. Patches available on request.

Also, Lua is maybe not widely known, but it is well suited for embedded
usage and extending other programs with scriptability, low memory
footprint and design minimalism. www.lua.org is ultimate source of
information.

Look at attachment, it is simple script illustrating usage of Lua
plugin. For test, I added a button to main taskbar, invoking this
script. What it does:

- gets message list for active (selected) folder

- creates table indexed with message id

- for every message, if there is a in-reply-to header, and its id
  points to a message in the same folder, increment nreplies property
  for this (parent) message

- when done, copy nreplies for all messages to message score

Now, sorting message by scores, you get something resembling order you
want, partially. This was meant as an illustration, evaluating thread
length is a bit more complicated.

Also, there is another drawback - setting score in Lua script does not
cause redrawing line in message summary window. So, if you setup
your summary with scores displayed, invoke my script does set score,
but new score is not displayed immediatelly. If you select sorting by
score, it does reflect scores computed... this is due quite simple
score handling in my plugin.

Next drawback is score handling in Claws Mail - score is not
persistent. Restart Claws Mail and all scores are reset to zero. Under
other condition score for a message is reset as well.

Is this usefull for you? Would you like to test? Evaluate yourself...

Regards,
Milan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nreplies
Type: application/octet-stream
Size: 502 bytes
Desc: not available
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20220612/d3917a33/attachment.obj>


More information about the Users mailing list