X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FFilter%2FRubyLang.pm;h=094ac1c2e7f6b56fe22b017ba80873c5e522b0ea;hb=9bd675d33ad1e49bd2ebe12a1d216216e61380de;hp=cb69e38a68aa01891287edd8b53448e53cd36259;hpb=cfb8d16578e7f2f2e300f9f436205e4a8fc7f322;p=public-inbox.git diff --git a/lib/PublicInbox/Filter/RubyLang.pm b/lib/PublicInbox/Filter/RubyLang.pm index cb69e38a..094ac1c2 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 @@ -30,7 +30,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 +43,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; }