diff options
Diffstat (limited to 'lib/PublicInbox/IMAPD.pm')
-rw-r--r-- | lib/PublicInbox/IMAPD.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/PublicInbox/IMAPD.pm b/lib/PublicInbox/IMAPD.pm index b647c940..6488dc0f 100644 --- a/lib/PublicInbox/IMAPD.pm +++ b/lib/PublicInbox/IMAPD.pm @@ -72,7 +72,12 @@ sub imapd_refresh_finalize { map { my $no = $mailboxes->{$_} == $dummy ? '' : 'No'; qq[* LIST (\\Has${no}Children) "." $_\r\n] - } sort { length($a) <=> length($b) } keys %$mailboxes + } sort { + # shortest names first, alphabetically if lengths match + length($a) == length($b) ? + ($a cmp $b) : + (length($a) <=> length($b)) + } keys %$mailboxes ]; $imapd->{pi_config} = $pi_config; if (my $idler = $imapd->{idler}) { |