]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www_text: add AUTH=ANONYMOUS to IMAP URLs
authorEric Wong <e@80x24.org>
Wed, 10 Aug 2022 07:40:31 +0000 (07:40 +0000)
committerEric Wong <e@80x24.org>
Wed, 10 Aug 2022 15:56:11 +0000 (15:56 +0000)
While the ';' requires escaping on the command-line, the
presence of ";AUTH=ANONYMOUS" communicates clearly that
anonymous access is supported in accordance to RFC 4505.

lib/PublicInbox/WwwText.pm

index 71b04561380d19d540595cda06db35ff4a379489..c067369ea8afe40499820fcc8e9740e3300f711c 100644 (file)
@@ -276,10 +276,12 @@ sub _add_non_http_urls ($$) {
        $ctx->{ibx}->can('nntp_url') or return; # TODO extindex can have IMAP
        my $urls = $ctx->{ibx}->imap_url($ctx);
        if (@$urls) {
-               $$txt .= "\nIMAP subfolder(s) are available under:";
-               $$txt .= "\n  " . join("\n  ", @$urls);
+               $urls = join("\n  ", @$urls);
+               $urls =~ s!://([^/@]+)/!://;AUTH=ANONYMOUS\@$1/!sg;
                $$txt .= <<EOM
 
+IMAP subfolder(s) are available under:
+  $urls
   # each subfolder (starting with `0') holds 50K messages at most
 EOM
        }