about summary refs log tree commit homepage
path: root/lib/PublicInbox/IMAP.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-10 07:04:45 +0000
committerEric Wong <e@yhbt.net>2020-06-13 07:55:45 +0000
commit1c56782dbe1bd38d48c7e94d9aa2265377ba3842 (patch)
tree2861bbf01ad37a4c828019dbf0f56a7a290ded82 /lib/PublicInbox/IMAP.pm
parent27f17d80e4e8e15b5e7d50045b1853ec7bdb4b3b (diff)
downloadpublic-inbox-1c56782dbe1bd38d48c7e94d9aa2265377ba3842.tar.gz
Some clients insist on sending "INBOX" in all caps,
since it's special in RFC 3501.
Diffstat (limited to 'lib/PublicInbox/IMAP.pm')
-rw-r--r--lib/PublicInbox/IMAP.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm
index 5865822f..8c6fa7b6 100644
--- a/lib/PublicInbox/IMAP.pm
+++ b/lib/PublicInbox/IMAP.pm
@@ -537,7 +537,7 @@ sub uid_fetch_m { # long_response
 
 sub cmd_status ($$$;@) {
         my ($self, $tag, $mailbox, @items) = @_;
-        my $ibx = $self->{imapd}->{mailboxes}->{$mailbox} or
+        my $ibx = $self->{imapd}->{mailboxes}->{lc $mailbox} or
                 return "$tag NO Mailbox doesn't exist: $mailbox\r\n";
         return "$tag BAD no items\r\n" if !scalar(@items);
         ($items[0] !~ s/\A\(//s || $items[-1] !~ s/\)\z//s) and
@@ -571,7 +571,8 @@ sub cmd_list ($$$$) {
                 # request for hierarchy delimiter
                 $l = [ qq[* LIST (\\Noselect) "." ""\r\n] ];
         } elsif ($refname ne '' || $wildcard ne '*') {
-                $wildcard =~ s!([^a-z0-9_])!$patmap{$1} // "\Q$1"!eig;
+                $wildcard = lc $wildcard;
+                $wildcard =~ s!([^a-z0-9_])!$patmap{$1} // "\Q$1"!eg;
                 $l = [ grep(/ \Q$refname\E$wildcard\r\n\z/s, @$l) ];
         }
         \(join('', @$l, "$tag OK List done\r\n"));