public-inbox-mda | 15 +++++++++++++++ diff --git a/public-inbox-mda b/public-inbox-mda index 411ac15f7f396a35b95b23387cd133f0f1e4deed..6e66fa71da63c56ccfcf3cfea5390696ae01e117 100755 --- a/public-inbox-mda +++ b/public-inbox-mda @@ -42,6 +42,7 @@ if (PublicInbox::Filter->run($simple)) { # run spamc again on the HTML-free message if (do_spamc($simple, \$filtered)) { $simple = Email::Simple->new($filtered); + set_list_headers($simple, $dst); $filter->simple($simple); my $from = $filter->from; @@ -74,3 +75,17 @@ }; return ($@ || $? || !defined($$out) || length($$out) == 0) ? 0 : 1; } + +# RFC2919 and RFC2369 +sub set_list_headers { + my ($simple, $dst) = @_; + my $pa = "<$dst->{-primary_address}>"; + $simple->header_set("List-Id", $pa); + $simple->header_set("List-Post", $pa); + + my $url = $dst->{url}; + if (defined $url) { + $simple->header_set("List-Archive", "<$url>"); + $simple->header_set("List-Help", "<${url}help>"); + } +}