2001-10-01 Simon Josefsson <jas@extundo.com>
authorSimon Josefsson <jas@extundo.com>
Mon, 1 Oct 2001 20:18:39 +0000 (20:18 +0000)
committerSimon Josefsson <jas@extundo.com>
Mon, 1 Oct 2001 20:18:39 +0000 (20:18 +0000)
* mail-source.el (mail-source-fetch-imap): Use BODY.PEEK if server
is IMAP4rev1.

lisp/ChangeLog
lisp/mail-source.el

index 2e56888..8bcb381 100644 (file)
@@ -1,5 +1,8 @@
 2001-10-01  Simon Josefsson  <jas@extundo.com>
 
+       * mail-source.el (mail-source-fetch-imap): Use BODY.PEEK if server
+       is IMAP4rev1.
+
        * nnml.el (gnus-article-unpropagatable-p): Autoload gnus-sum.
 
        * nnfolder.el: Ditto.
index 94c3eef..3f1f220 100644 (file)
@@ -901,7 +901,10 @@ This only works when `display-time' is enabled."
                  (push (cons from imap-password) mail-source-password-cache)))
              ;; if predicate is nil, use all uids
              (dolist (uid (imap-search (or predicate "1:*") buf))
-               (when (setq str (imap-fetch uid "RFC822.PEEK" 'RFC822 nil buf))
+               (when (setq str (if (imap-capability 'IMAP4rev1 buf)
+                                   (imap-fetch uid "BODY.PEEK[]" 'BODYDETAIL
+                                               nil buf)
+                           (imap-fetch uid "RFC822.PEEK" 'RFC822 nil buf)))
                  (push uid remove)
                  (insert "From imap " (current-time-string) "\n")
                  (save-excursion