From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A92D61FC0B for ; Thu, 9 Sep 2021 05:25:06 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 8/8] net_reader: support Mail::IMAPClient Ignoresizeerrors Date: Thu, 9 Sep 2021 05:25:05 +0000 Message-Id: <20210909052505.7174-9-e@80x24.org> In-Reply-To: <20210909052505.7174-1-e@80x24.org> References: <20210909052505.7174-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Some proprietary servers may do wacky things and give the wrong size, so Mail::IMAPClient has a knob for this which we can expose to users to workaround this. --- lib/PublicInbox/NetReader.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm index 181741f6..a0e52fc5 100644 --- a/lib/PublicInbox/NetReader.pm +++ b/lib/PublicInbox/NetReader.pm @@ -285,12 +285,16 @@ sub imap_common_init ($;$) { my $mic_common = {}; # scheme://authority => Mail:IMAPClient arg for my $uri (@{$self->{imap_order}}) { my $sec = uri_section($uri); - for my $k (qw(Starttls Debug Compress)) { + + # knobs directly for Mail::IMAPClient->new + for my $k (qw(Starttls Debug Compress Ignoresizeerrors)) { my $bool = cfg_bool($cfg, "imap.$k", $$uri) // next; $mic_common->{$sec}->{$k} = $bool; } my $to = cfg_intvl($cfg, 'imap.timeout', $$uri); $mic_common->{$sec}->{Timeout} = $to if $to; + + # knobs we use ourselves: my $sa = socks_args($cfg->urlmatch('imap.Proxy', $$uri)); $self->{cfg_opt}->{$sec}->{-proxy_cfg} = $sa if $sa; for my $k (qw(pollInterval idleInterval)) {