Sometimes an email is an innocent removal "rm" for a
misdirected, off-topic post, while most removed messages are
"spam". Allow anybody to look at history and easily distinguish
the reason for removing the message.
# ('MISMATCH', msg) on mismatch
# (:MARK, msg) on success
sub remove {
# ('MISMATCH', msg) on mismatch
# (:MARK, msg) on success
sub remove {
- my ($self, $mime) = @_; # mime = Email::MIME
+ my ($self, $mime, $msg) = @_; # mime = Email::MIME
my $mid = mid_mime($mime);
my $path = mid2path($mid);
my $mid = mid_mime($mime);
my $path = mid2path($mid);
}
my $ident = $self->{ident};
my $now = now2822();
}
my $ident = $self->{ident};
my $now = now2822();
+ $msg ||= 'rm';
+ my $len = length($msg) + 1;
print $w "commit $ref\nmark :$commit\n",
"author $ident $now\n",
"committer $ident $now\n",
print $w "commit $ref\nmark :$commit\n",
"author $ident $now\n",
"committer $ident $now\n",
'from ', ($parent ? $parent : $tip), "\n" or wfail;
print $w "D $path\n\n" or wfail;
$self->{nchg}++;
'from ', ($parent ? $parent : $tip), "\n" or wfail;
print $w "D $path\n\n" or wfail;
$self->{nchg}++;
# may train for each cross-posted message, and this
# script already learns for every list in
# ~/.public-inbox/config
# may train for each cross-posted message, and this
# script already learns for every list in
# ~/.public-inbox/config
+ $im->remove($mime, $train);
} else { # $train eq "ham"
# no checking for spam here, we assume the message has
# been reviewed by a human at this point:
} else { # $train eq "ham"
# no checking for spam here, we assume the message has
# been reviewed by a human at this point: