(nnimap-split-download-body): New variable.
authorSimon Josefsson <jas@extundo.com>
Wed, 15 Jan 2003 17:56:32 +0000 (17:56 +0000)
committerSimon Josefsson <jas@extundo.com>
Wed, 15 Jan 2003 17:56:32 +0000 (17:56 +0000)
(nnimap-split-articles): Use it.

lisp/ChangeLog
lisp/nnimap.el

index 0cbecca..e43bbbe 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-15  Simon Josefsson  <jas@extundo.com>
+
+       * nnimap.el (nnimap-split-download-body): New variable.
+       (nnimap-split-articles): Use it.
+
 2003-01-15  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus.el (gnus-install-group-spam-parameters): new variable, t by
index f4e9c35..3384028 100644 (file)
@@ -195,6 +195,14 @@ RFC2060 section 6.4.4."
   :group 'nnimap
   :type 'sexp)
 
+(defcustom nnimap-split-download-body nil
+  "Whether to download entire articles during splitting.
+This is generally not required, and will slow things down considerably.
+You may need it if you want to use an advanced splitting function that
+analyses the body before splitting the article."
+  :group 'nnimap
+  :type 'boolean)
+
 ;; Performance / bug workaround variables
 
 (defcustom nnimap-close-asynchronous t
@@ -1246,7 +1254,10 @@ function is generally only called when Gnus is shutting down."
          (when (setq rule (nnimap-split-find-rule server inbox))
            ;; iterate over articles
            (dolist (article (imap-search nnimap-split-predicate))
-             (when (nnimap-request-head article)
+             (when (if nnimap-split-download-body
+                       (and (nnimap-request-article article)
+                            (mail-narrow-to-head))
+                     (nnimap-request-head article))
                ;; copy article to right group(s)
                (setq removeorig nil)
                (dolist (to-group (nnimap-split-to-groups rule))
@@ -1270,6 +1281,8 @@ function is generally only called when Gnus is shutting down."
                        (t
                         (message "IMAP split failed to move %s:%s:%d to %s"
                                  server inbox article to-group))))
+               (if nnimap-split-download-body
+                   (widen))
                ;; remove article if it was successfully copied somewhere
                (and removeorig
                     (imap-message-flags-add (format "%d" article)