From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E8D121FA02 for ; Thu, 23 Apr 2020 08:34:19 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] watchmaildir: match List-ID case-insensitively Date: Thu, 23 Apr 2020 08:34:19 +0000 Message-Id: <20200423083419.835-3-e@yhbt.net> In-Reply-To: <20200423083419.835-1-e@yhbt.net> References: <20200423083419.835-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index 02e4b32f..71bd84fc 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -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 ]; } }