Synch with Oort Gnus.
[elisp/gnus.git-] / lisp / mail-source.el
index 43cf3a0..6cc9e78 100644 (file)
@@ -925,10 +925,11 @@ 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 (if (imap-capability 'IMAP4rev1 buf)
-                                   (imap-fetch uid "BODY.PEEK[]" 'BODYDETAIL
-                                               nil buf)
-                           (imap-fetch uid "RFC822.PEEK" 'RFC822 nil buf)))
+               (when (setq str
+                           (if (imap-capability 'IMAP4rev1 buf)
+                               (caddar (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
@@ -944,7 +945,7 @@ This only works when `display-time' is enabled."
               fetchflag nil buf))
            (if dontexpunge
                (imap-mailbox-unselect buf)
-             (imap-mailbox-close buf))
+             (imap-mailbox-close nil buf))
            (imap-close buf))
        (imap-close buf)
        ;; We nix out the password in case the error