TB - Sort add-on

Cameron Simpson cs at zip.com.au
Mon Jul 6 07:53:38 UTC 2015


On 06Jul2015 01:22, g <geleem at bellsouth.net> wrote:
>On 07/06/15 00:21, Cameron Simpson wrote:
>> He basicly needs to take his messages and append them to a new inbox in
>> date order. He can either write a small program to suck messages into
>> memory, sort them, then write them out, or find a mail client which will
>> let him sort the view by date, tag/mark all the messages, then feed them
>> all _in_view_order_ to a fresh folder/mbox/mail-filing program.
>
>that could work, tho i believe first scanning emails to build a sort table,
>then pull out emails to a new file according to table would run better
>than having to keep up with where emails are in memory.

Depending on the library in use. In Python I'd just read them all into 
Messages, which will keep the whole message in memory. Sort them, write them. I 
agree scanning first would be more memory efficient: scan, sort scan offsets, 
read file chunks in sorted scan order. Might even be easier.

>> He sould at first cut try that in TB, since that's what he's using:
>>   - view by date
>>   - _copy_ all messages to new folder
>>   - quit TB and examine the new folder to see what physical order it has
>
>if that would work it would be great. unfortunately, thunderbird does not
>work that. [...]
>> The catch of course is that one can easily imagine a mail reader choosing
>> to do that copy in the present physical order for I/O efficiency reasons [...]
>it does seem that is attitude of thunderbird devs because if one sorts
>emails chronologically then moves or copies to new folder file, emails
>will maintain order they were in original folder file.

Inconvenient.

[...]
>> Or one can write a program, where one has complete control. But if you
>> can get a mail client to do it then that will probably be faster.
>
>such is true. also true is fact thunderbird is not such a client.

But a brief experiment here suggests that mutt _is_ such a client. So he couldd 
open the original mbox in moutt, sort the view, tag all messages (T.<enter>) 
then copy all tagged messages to a new folder (;Cnew_folder<enter>).

Cheers,
Cameron Simpson <cs at zip.com.au>

You see, wire telegraph is a kind of a very, very long cat. You pull his tail
in New York and his head is meowing in Los Angeles. Do you understand this?
And radio operates exactly the same way: you send signals here, they receive
them there. The only difference is that there is no cat.
- Albert Einstein, when asked to describe radio


More information about the users mailing list