TB - Sort add-on

Cameron Simpson cs at zip.com.au
Sun Jul 5 04:00:17 UTC 2015


On 04Jul2015 21:10, jd1008 <jd1008 at gmail.com> wrote:
>Looked for an add-on that will sort a folder by date (not for display 
>purposes)
>but to physically re-organize a floder's messages so that they are 
>sorted from oldest
>to most recent.
>
>Any info on that?

Not offhand, but had you considered using external tools?

TB local folders are UNIX mbox files. If you should down TB, you can modify the 
mbox file as you see fit and then blow away TB's index file for that folder. TB 
will reread the mbox and reconstruct the index file with the correct values 
when you open it again.

If you go this way you could use something like mutt to open the folder, sort 
by date (a purely visual effect) and save the messages to another mbox file.  
See if they are saved in date order in the new file (by looking at it with a 
tool like "less", or any other text file viewer). If so, copy the new folder 
back onto the TB folder file.

Or you could write a short program to read the mbox file into memory (this 
would be easy in Python, which has mbox reading library functions), sorts the 
messages, and writes them out in date order to a new file. Then copy back to 
the TB folder.

Etc.

Remember to take a backup first! (Just copy your whole TB folder directory in 
case of accidents.)

Finally, _why_ do you want the TB folder in date order, physically? What is the 
objective here?

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

That's just the sort of bloody stupid name they would choose.
        - Reginald Mitchell, designer of the Spitfire


More information about the users mailing list