X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=lib%2FPublicInbox%2FFilter%2FRubyLang.pm;h=3a8dd881ebfd9e2ee8c9b08ca8d98866079714f1;hp=cb69e38a68aa01891287edd8b53448e53cd36259;hb=55b707d788ce13696e4411389583e720ea6dab01;hpb=cfb8d16578e7f2f2e300f9f436205e4a8fc7f322
diff --git a/lib/PublicInbox/Filter/RubyLang.pm b/lib/PublicInbox/Filter/RubyLang.pm
index cb69e38a..3a8dd881 100644
--- a/lib/PublicInbox/Filter/RubyLang.pm
+++ b/lib/PublicInbox/Filter/RubyLang.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2017-2018 all contributors
+# Copyright (C) 2017-2019 all contributors
# License: AGPL-3.0+
# Filter for lists.ruby-lang.org trailers
@@ -22,7 +22,6 @@ sub new {
$altid ||= $ibx->{altid}->[0];
}
if ($altid) {
- require PublicInbox::MID; # mid_clean
require PublicInbox::AltId;
$self->{-altid} = PublicInbox::AltId->new($ibx, $altid, 1);
}
@@ -30,7 +29,7 @@ sub new {
}
sub scrub {
- my ($self, $mime) = @_;
+ my ($self, $mime, $for_remove) = @_;
# no msg_iter here, that is only for read-only access
$mime->walk_parts(sub {
my ($part) = $_[0];
@@ -43,14 +42,14 @@ sub scrub {
}
});
my $altid = $self->{-altid};
- if ($altid) {
+ if ($altid && !$for_remove) {
my $hdr = $mime->header_obj;
my $mids = mids($hdr);
return $self->REJECT('Message-ID missing') unless (@$mids);
my @v = $hdr->header_raw('X-Mail-Count');
my $n;
foreach (@v) {
- /\A\s*(\d+)\s*\z/ or next;
+ /\A\s*([0-9]+)\s*\z/ or next;
$n = $1;
last;
}