]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Filter/RubyLang.pm
filter/rubylang: do not set altid on spam training
[public-inbox.git] / lib / PublicInbox / Filter / RubyLang.pm
index cb69e38a68aa01891287edd8b53448e53cd36259..a43d67a9352e4ea6ab71aad954b3fe44933d55e3 100644 (file)
@@ -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,7 +43,7 @@ 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);