From 403177efccc2b1c3883eb7b7dd3985d947828481 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 23 Jun 2017 00:47:23 +0000 Subject: watchmaildir: deal with rejected (100) messages The RubyLang filter is strict about what messages it rejects, so the spam learning path will not auto-train or remove messages missing X-Mail-Count headers. --- lib/PublicInbox/WatchMaildir.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index 8588f16c..c15e1384 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -108,6 +108,7 @@ sub _remove_spam { $im->remove($mime); if (my $scrub = _scrubber_for($ibx)) { my $scrubbed = $scrub->scrub($mime) or return; + $scrubbed == 100 and return; $im->remove($scrubbed); } }; @@ -169,7 +170,9 @@ sub _try_path { return unless ($v && $v =~ $wm->[1]); } if (my $scrub = _scrubber_for($inbox)) { - $mime = $scrub->scrub($mime) or return; + my $ret = $scrub->scrub($mime) or return; + $ret == 100 and return; + $mime = $ret; } _force_mid($mime); -- cgit v1.2.3-24-ge0c7