1 # Copyright (C) 2018-2020 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # Filter for importing some archives from gmane
5 package PublicInbox::Filter::Gmane;
6 use base qw(PublicInbox::Filter::Base);
11 my ($self, $mime) = @_;
12 my $hdr = $mime->header_obj;
14 # gmane rewrites Received headers, which increases spamminess
15 # Some older archives set Original-To
16 foreach my $x (qw(Received To)) {
17 my @h = $hdr->header_raw("Original-$x");
19 $hdr->header_set($x, @h);
20 $hdr->header_set("Original-$x");
24 # Approved triggers for the SA HEADER_SPAM rule,
25 # X-From is gmane specific
26 foreach my $drop (qw(Approved X-From)) {
27 $hdr->header_set($drop);
30 # appears to be an old gmane bug:
31 $hdr->header_set('connect()');
37 my ($self, $mime) = @_;