]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwText.pm
www_text: add AUTH=ANONYMOUS to IMAP URLs
[public-inbox.git] / lib / PublicInbox / WwwText.pm
index 369328eef6f717bfd8712d45ca5b5fcdc2727a5c..c067369ea8afe40499820fcc8e9740e3300f711c 100644 (file)
@@ -67,6 +67,9 @@ sub get_text {
                $txt = ascii_html($txt);
        }
        $txt = '<pre>' . $l->linkify_2($txt) . '</pre>';
+       $txt =~ s!\bPOP3\b!<a\nid=pop3>POP3</a>!;
+       $txt =~ s!\bNewsgroups\b!<a\nid=nntp>Newsgroups</a>!;
+       $txt =~ s!\bIMAP\b!<a\nid=imap>IMAP</a>!;
        PublicInbox::WwwStream::html_oneshot($ctx, $code, \$txt);
 }
 
@@ -273,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
        }
@@ -294,8 +299,8 @@ EOM
 POP3 access is available:
   $urls
 
-The password is: anonymous
-The username is: \$(uuidgen)\@$ctx->{ibx}->{newsgroup}
+The POP3 password is: anonymous
+The POP3 username is: \$(uuidgen)\@$ctx->{ibx}->{newsgroup}
 where \$(uuidgen) in the output of the `uuidgen' command on your system.
 The UUID in the username functions as a private cookie (don't share it).
 Idle accounts will expire periodically.