]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/NetReader.pm
net_reader: disallow imap.fetchBatchSize=0
[public-inbox.git] / lib / PublicInbox / NetReader.pm
index e305523e300b16c2b32b59442ecadf44be683c02..fbe1ac4fa726b4ac1bc44e84d63f667d3275902e 100644 (file)
@@ -344,10 +344,10 @@ sub imap_common_init ($;$) {
                }
                my $k = 'imap.fetchBatchSize';
                my $bs = $cfg->urlmatch($k, $$uri) // next;
-               if ($bs =~ /\A([0-9]+)\z/) {
+               if ($bs =~ /\A([0-9]+)\z/ && $bs > 0) {
                        $self->{cfg_opt}->{$sec}->{batch_size} = $bs;
                } else {
-                       warn "$k=$bs is not an integer\n";
+                       warn "$k=$bs is not a positive integer\n";
                }
        }
        # make sure we can connect and cache the credentials in memory