From db7c206a4e2c71d08dd286d6dfa92431976e9693 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 9 Dec 2020 23:33:00 +0000 Subject: www+nntp: deal with lack of addresses for ->ALL Since extindex is an amalgamation of several inboxes, discerning an appropriate address for List-Post: would be expensive and most likely unnecessary. Some legacy/historical inboxes may have no active address, either, so don't attempt to set the List-Post header if no addresses are configured. --- lib/PublicInbox/Mbox.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'lib/PublicInbox/Mbox.pm') diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm index 64de8c72..c88350c9 100644 --- a/lib/PublicInbox/Mbox.pm +++ b/lib/PublicInbox/Mbox.pm @@ -106,7 +106,6 @@ sub msg_hdr ($$;$) { my @append = ( 'Archived-At', "<$base$mid/>", 'List-Archive', "<$base>", - 'List-Post', "{-primary_address}>", ); my $crlf = $header_obj->crlf; my $buf = $header_obj->as_string; @@ -118,13 +117,11 @@ sub msg_hdr ($$;$) { my $k = $append[$i]; my $v = $append[$i + 1]; my @v = $header_obj->header_raw($k); - foreach (@v) { - if ($v eq $_) { - $v = undef; - last; - } - } - $buf .= "$k: $v$crlf" if defined $v; + $buf .= "$k: $v$crlf" if !grep(/\A\Q$v\E\z/, @v); + } + my $post_addr = $ibx->{-primary_address}; + if ($post_addr && $header_obj->header_raw('List-Post')) { + $buf .= "List-Post: $crlf"; } $buf .= $crlf; } -- cgit v1.2.3-24-ge0c7