* mm-view.el (mml-smime): Require.
[gnus] / lisp / nnimap.el
index 4eb904e..1899b0e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; nnimap.el --- IMAP interface for Gnus
 
-;; Copyright (C) 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;         Simon Josefsson <simon@josefsson.org>
@@ -167,7 +167,8 @@ textual parts.")
          (nnimap-article-ranges (gnus-compress-sequence articles))
          (nnimap-header-parameters))
         t)
-       (nnimap-transform-headers))
+       (nnimap-transform-headers)
+       (nnheader-remove-cr-followed-by-lf))
       (insert-buffer-substring
        (nnimap-find-process-buffer (current-buffer))))
     'headers))
@@ -638,7 +639,7 @@ textual parts.")
   (let ((result (nnimap-possibly-change-group
                 ;; Don't SELECT the group if we're going to select it
                 ;; later, anyway.
-                (if (and dont-check
+                (if (and (not dont-check)
                          (assoc group nnimap-current-infos))
                     nil
                   group)
@@ -907,7 +908,8 @@ textual parts.")
                    '((subscribe "SUBSCRIBE")
                      (unsubscribe "UNSUBSCRIBE")))))
       (when command
-       (nnimap-command "%s %S" command (utf7-encode group t))))))
+       (with-current-buffer (nnimap-buffer)
+         (nnimap-command "%s %S" (cadr command) (utf7-encode group t)))))))
 
 (deffoo nnimap-request-set-mark (group actions &optional server)
   (when (nnimap-possibly-change-group group server)
@@ -1564,10 +1566,11 @@ textual parts.")
                            (format "^%d .*\n" sequence)
                            (if nnimap-streaming
                                (max (point-min)
-                                    (- (point) 500)
-                                    (save-excursion
-                                      (forward-line -1)
-                                      (point)))
+                                    (min
+                                     (- (point) 500)
+                                     (save-excursion
+                                       (forward-line -3)
+                                       (point))))
                              (point-min))
                            t)))
            (when messagep