Frequently, I want to apply a number of patches with git-am(1) and save those in Evolution, but Evolution manages to save them in any arbitrary order.

I wrote this small script to sort such an mbox file based on arbitrary criteria.

The python script is available at http://johannes.sipsolutions.net/files/mboxsort.txt.