IMAIL provides several commands that change the order of messages within a folder. These commands are closely modelled on those of Rmail. Note that these commands don't modify the folder itself; they only modify the way that the folder behaves. This means that if a folder buffer is deleted, the sort order associated with that buffer is deleted too.
imail-sort-by-arrival). This is the default; this sort undoes any other sorting on the folder.
The IMAIL sort commands perform a stable sort: if
there is no reason to prefer either one of two messages, their order
remains unchanged. You can use this to sort by more than one
criterion. For example, if you use
imail-sort-by-date and then
imail-sort-by-author, messages from the same author appear in
order by date.
With a numeric argument, all these commands reverse the order of comparison. This means they sort messages from newest to oldest, from biggest to smallest, or in reverse alphabetical order.