- # prevent process growth by forking a new process for each message
- my $pid = fork;
- die "failed to fork: $!\n" unless defined $pid;
-
- if ($pid == 0) {
- my $f = Email::Filter->new(data => eval { local $/; <$fh> });
- close $fh;
- $fh = undef;
- my $s = $f->simple;
-
- # gmane rewrites Received headers, which increases spamminess
- # Some older archives set Original-To
- foreach my $x (qw(Received To)) {
- my @h = $s->header("Original-$x");
- if (@h) {
- $s->header_set($x, @h);
- $s->header_set("Original-$x");
- }
- }
-
- # triggers for the SA HEADER_SPAM rule
- foreach my $drop (qw(Approved)) { $s->header_set($drop) }
-
- # appears to be an old gmane bug:
- $s->header_set('connect()');