From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#44981: 28.0.50; Restore nnimap-split-download-body? Date: Wed, 02 Dec 2020 15:56:22 -0800 Message-ID: <87v9djsqxl.fsf@ericabrahamsen.net> References: <87y2iip3ky.fsf@ericabrahamsen.net> <878sag4i4f.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21875"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: 44981@debbugs.gnu.org Cancel-Lock: sha1:u5ZdGI+c1fk6h+OwDxQ49MLwHvg= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 03 00:57:36 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkc06-0005aH-Iv for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Dec 2020 00:57:34 +0100 Original-Received: from localhost ([::1]:32830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkc05-0006bQ-Lo for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Dec 2020 18:57:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkbza-0006Ax-9W for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2020 18:57:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54385) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkbza-0000ah-2o for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2020 18:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kkbzZ-00086x-Uw for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2020 18:57:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87y2iip3ky.fsf@ericabrahamsen.net> Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Dec 2020 23:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44981 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160695340331153 (code B ref -1); Wed, 02 Dec 2020 23:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Dec 2020 23:56:43 +0000 Original-Received: from localhost ([127.0.0.1]:37698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkbz9-00086H-Pd for submit@debbugs.gnu.org; Wed, 02 Dec 2020 18:56:43 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:58904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkbz8-000868-4M for submit@debbugs.gnu.org; Wed, 02 Dec 2020 18:56:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkbz6-0005vO-Rh for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2020 18:56:33 -0500 Original-Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:60652 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkbz5-0000XZ-3S for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2020 18:56:32 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kkbz1-0004K5-66 for bug-gnu-emacs@gnu.org; Thu, 03 Dec 2020 00:56:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:194840 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Eric Abrahamsen writes: > >> This looks unintentional, and I'd like to apply the attached diff, >> restoring `nnimap-split-download-body' as a user option, and getting rid >> of the default variable, which seems unnecessary. If this seems okay >> I'll do up a proper commit, and make sure the documentation is all >> accurate. > > I think it's unintentional, yes, so that sounds like a good plan. You > can't get rid of the variable, though (there'll be external packages > relying on it), but you can make it obsolete. > >> The same user who reported this also expressed a desire to be able to >> download message bodies conditionally, based on the headers, only if >> a split rule required it. I'm not at all sure about the feasibility of >> that, but wanted to see if anyone else had an opinion. > > I don't see any way to do that without making splitting unbearably slow. No, me neither. Here's a proper commit. I moved the bulk of the documentation to the section on IMAP client-side splitting. Originally it was only mentioned in the docs for the Spam package, with a link to IMAP splitting, but then not actually mentioned in the IMAP splitting section. Eric --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Restore-nnimap-split-download-body-as-a-customizatio.patch >From 668f59da7b58e6c24b3bac7f6b5e02103d32363a Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Wed, 2 Dec 2020 15:52:25 -0800 Subject: [PATCH] Restore nnimap-split-download-body as a customization option * lisp/gnus/nnimap.el (nnimap-split-download-body): And add an obsolete alias for `nnimap-split-download-body-default'. (nnimap-fetch-inbox): Check the value of the option, not the variable. * doc/misc/gnus.texi (Client-Side IMAP Splitting): Move the primary documentation of this option to this section. --- doc/misc/gnus.texi | 16 +++++++++------- lisp/gnus/nnimap.el | 15 +++++++++++---- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 81ce13945c..4aa07ce388 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -14521,6 +14521,14 @@ Client-Side IMAP Splitting @end table +@vindex nnimap-split-download-body +By default, the nnimap back end only retrieves the message headers; +the option @code{nnimap-split-download-body} (which is a regular +customization option, not a server variable) tells it to retrieve the +message bodies as well. We don't set this by default because it will +slow @acronym{IMAP} down, and that is not an appropriate decision to +make on behalf of the user. + Here's a complete example @code{nnimap} backend with a client-side ``fancy'' splitting method: @@ -24622,13 +24630,7 @@ Filtering Incoming Mail Note for IMAP users: if you use the @code{spam-check-bogofilter}, @code{spam-check-ifile}, and @code{spam-check-stat} spam back ends, you should also set the variable @code{nnimap-split-download-body} to -@code{t}. These spam back ends are most useful when they can ``scan'' -the full message body. By default, the nnimap back end only retrieves -the message headers; @code{nnimap-split-download-body} tells it to -retrieve the message bodies as well. We don't set this by default -because it will slow @acronym{IMAP} down, and that is not an -appropriate decision to make on behalf of the user. @xref{Client-Side -IMAP Splitting}. +@code{t}. @xref{Client-Side IMAP Splitting}. You have to specify one or more spam back ends for @code{spam-split} to use, by setting the @code{spam-use-*} variables. @xref{Spam Back diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 7984998d21..e7f9451986 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -146,13 +146,20 @@ nnimap-request-articles-find-limit :version "24.4" :group 'nnimap) +(defcustom nnimap-split-download-body nil + "If non-nil, make message bodies available for consideration during splitting. +This requires downloading the full message from the IMAP server +during splitting, which may be slow." + :type 'boolean) + +(define-obsolete-variable-alias + 'nnimap-split-download-body-default 'nnimap-split-download-body + "28.1") + (defvar nnimap-process nil) (defvar nnimap-status-string "") -(defvar nnimap-split-download-body-default nil - "Internal variable with default value for `nnimap-split-download-body'.") - (defvar nnimap-keepalive-timer nil) (defvar nnimap-process-buffers nil) @@ -2100,7 +2107,7 @@ nnimap-fetch-inbox "BODY.PEEK" "RFC822.PEEK")) (cond - (nnimap-split-download-body-default + (nnimap-split-download-body "[]") ((nnimap-ver4-p) "[HEADER]") -- 2.29.2 --=-=-=--