* imap.el (imap-shell-open): Allow non-list `imap-shell-program'.
authorSimon Josefsson <jas@extundo.com>
Mon, 12 Aug 2002 21:34:06 +0000 (21:34 +0000)
committerSimon Josefsson <jas@extundo.com>
Mon, 12 Aug 2002 21:34:06 +0000 (21:34 +0000)
(imap-shell-open): Skip initial junk before IMAP greeting.

lisp/ChangeLog
lisp/imap.el

index bf46209..82795ef 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-12  Simon Josefsson  <jas@extundo.com>
+
+       * imap.el (imap-shell-open): Allow non-list `imap-shell-program'.
+       (imap-shell-open): Skip initial junk before IMAP greeting.
+
 2002-08-11  Simon Josefsson  <jas@extundo.com>
 
        * message-utils.el (message-xpost-default,
index 082c83c..d46794d 100644 (file)
@@ -672,7 +672,8 @@ If ARGS, PROMPT is used as an argument to `format'."
   nil)
 
 (defun imap-shell-open (name buffer server port)
-  (let ((cmds imap-shell-program)
+  (let ((cmds (if (listp imap-shell-program) imap-shell-program
+               (list imap-shell-program)))
        cmd done)
     (while (and (not done) (setq cmd (pop cmds)))
       (message "imap: Opening IMAP connection with `%s'..." cmd)
@@ -692,7 +693,8 @@ If ARGS, PROMPT is used as an argument to `format'."
        (when process
          (while (and (memq (process-status process) '(open run))
                      (set-buffer buffer) ;; XXX "blue moon" nntp.el bug
-                     (goto-char (point-min))
+                     (goto-char (point-max))
+                     (forward-line -1)
                      (not (imap-parse-greeting)))
            (accept-process-output process 1)
            (sit-for 1))