Sorting labels in the dump is useful when you e.g. want to keep track of
your dump using an incremental backup system that records diffs, with
this patch lines in the dump will only change when there is a real
change and no longer just because the random order of the labels
changes.
index.load
index.each_message :load_spam => true, :load_deleted => true, :load_killed => true do |m|
- puts "#{m.id} (#{m.labels.to_a * ' '})"
+ puts "#{m.id} (#{m.labels.to_a.sort_by { |l| l.to_s } * ' '})"
end