]> Sergey Matveev's repositories - public-inbox.git/commitdiff
watchmaildir: match List-ID case-insensitively
authorEric Wong <e@yhbt.net>
Thu, 23 Apr 2020 08:34:19 +0000 (08:34 +0000)
committerEric Wong <e@yhbt.net>
Sat, 25 Apr 2020 04:41:38 +0000 (04:41 +0000)
RFC 2919 section 6 states the following:

  There is only one operation defined for list identifiers,
  that of case insensitive equality.

So no arguing with that.  Now, the other headers are
open to interpretation, so put a note about them.

lib/PublicInbox/WatchMaildir.pm

index 02e4b32f254a8933e81e60b2001b8cc5ebce63c8..71bd84fc0d13c62941ca6a66a65aae03ab3029c8 100644 (file)
@@ -62,12 +62,17 @@ sub new {
                        if (my $whs = $ibx->{watchheader}) {
                                for (@$whs) {
                                        my ($k, $v) = split(/:/, $_, 2);
+                                       # XXX should this be case-insensitive?
+                                       # Or, mutt-style, case-sensitive iff
+                                       # a capital letter exists?
                                        push @$watch_hdrs, [ $k, qr/\Q$v\E/ ];
                                }
                        }
                        if (my $list_ids = $ibx->{listid}) {
                                for (@$list_ids) {
-                                       my $re = qr/<[ \t]*\Q$_\E[ \t]*>/;
+                                       # RFC2919 section 6 stipulates
+                                       # "case insensitive equality"
+                                       my $re = qr/<[ \t]*\Q$_\E[ \t]*>/i;
                                        push @$watch_hdrs, ['List-Id', $re ];
                                }
                        }