+sub _add_imap_nntp_urls ($$) {
+ my ($ctx, $txt) = @_;
+ $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);
+ $$txt .= <<EOM
+
+ # each subfolder (starting with `0') holds 50K messages at most
+EOM
+ }
+ $urls = $ctx->{ibx}->nntp_url($ctx);
+ if (@$urls) {
+ $$txt .= "\n";
+ $$txt .= @$urls == 1 ? 'Newsgroup' : 'Newsgroups are';
+ $$txt .= ' available over NNTP:';
+ $$txt .= "\n " . join("\n ", @$urls) . "\n";
+ }
+}
+
+sub _add_onion_note ($) {
+ my ($txt) = @_;
+ $$txt =~ m!\b[^:]+://\w+\.onion/!i and $$txt .= <<EOM
+
+note: .onion URLs require Tor: https://www.torproject.org/
+
+EOM
+}
+