From 763928565699beea87006156c565d0f808f9becc Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 19 Jun 2016 02:13:52 +0000 Subject: watch_maildir: tighten up path checks Only mark seen messages as spam, otherwise it could be too aggressive and cause problems or over training. We wouldn't want a wayward FIFO ruining our day, either :) --- t/watch_maildir.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/watch_maildir.t b/t/watch_maildir.t index 8a2c934a..e8c97406 100644 --- a/t/watch_maildir.t +++ b/t/watch_maildir.t @@ -25,6 +25,7 @@ Date: Sat, 18 Jun 2016 00:00:00 +0000 something EOF PublicInbox::Emergency->new($maildir)->prepare(\$msg); +ok(POSIX::mkfifo("$maildir/cur/fifo", 0777)); my $sem = PublicInbox::Emergency->new($spamdir); # create dirs my $config = PublicInbox::Config->new({ @@ -47,7 +48,7 @@ my $write_spam = sub { my @new = glob("$spamdir/new/*"); is(scalar @new, 1); my @p = split(m!/+!, $new[0]); - ok(link($new[0], "$spamdir/cur/".$p[-1])); + ok(link($new[0], "$spamdir/cur/".$p[-1].":2,S")); is(unlink($new[0]), 1); }; $write_spam->(); -- cgit v1.2.3-24-ge0c7