[publicinbox "test"]
watch = maildir:/path/to/maildirs/.INBOX.test/
-public-inbox 1.6.0 supports C<nntp://>, C<nntps://>,
+public-inbox 1.6.0+ supports C<nntp://>, C<nntps://>,
C<imap://> and C<imaps://> URLs:
watch = nntp://news.example.com/inbox.test.group
will require L<netrc(5)> and/or L<git-credential(1)> (preferred) to fill
in the username and password.
+public-inbox 2.0+ supports boolean C<false> to prevent the global
+L</publicinboxwatch.watchspam> directive from writing to the inbox.
+
Default: none
=item publicinbox.<name>.watchheader
$watches = PublicInbox::Config::_array($watches);
for my $watch (@$watches) {
my $uri;
- if (is_maildir($watch)) {
+ my $bool = $cfg->git_bool($watch);
+ if (defined $bool && !$bool) {
+ $ibx->{-watch_disabled} = 1;
+ } elsif (is_maildir($watch)) {
compile_watchheaders($ibx);
my ($new, $cur) = ("$watch/new", "$watch/cur");
my $cur_dst = $mdmap{$cur} //= [];
sub remove_eml_i { # each_inbox callback
my ($ibx, $self, $eml, $loc) = @_;
+ return if $ibx->{-watch_disabled};
eval {
# try to avoid taking a lock or unnecessary spawning
my $addr = 'test-public@example.com';
my $default_branch = PublicInbox::Import::default_branch;
PublicInbox::Import::init_bare($git_dir);
-
my $msg = <<EOF;
From: user\@example.com
To: $addr
something
EOF
+
+my $ibx_ro = create_inbox 'ro', sub { $_[0]->add(PublicInbox::Eml->new($msg)) };
+
PublicInbox::Emergency->new($maildir)->prepare(\$msg);
ok(POSIX::mkfifo("$maildir/cur/fifo", 0777),
'create FIFO to ensure we do not get stuck on it :P');
filter = PublicInbox::Filter::Vger
[publicinboxlearn]
watchspam = maildir:$spamdir
+[publicinbox "test-ro"]
+ watch = false
+ inboxdir = $ibx_ro->{inboxdir}
+ address = ro-test\@example.com
EOF
my $cfg_path = $cfg->{-f};
PublicInbox::Watch->new($cfg)->scan('full');
is(scalar @list, 0, 'tree is empty');
is(unlink(glob("$spamdir/cur/*")), 1, 'unlinked trained spam');
+@list = $ibx_ro->git->qx(qw(ls-tree -r --name-only), $default_branch);
+undef $ibx_ro;
+is scalar(@list), 1, 'read-only inbox is unchanged';
+
# check with scrubbing
{
$msg .= qq(--