Fix bug that caused server greeting to be thrown away. Change
authorChris Hanson <org/chris-hanson/cph>
Fri, 30 Jun 2000 17:19:53 +0000 (17:19 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 30 Jun 2000 17:19:53 +0000 (17:19 +0000)
handling of delimiter and namespace information, so that they are
set by the front end rather than that back end.

v7/src/imail/imail-imap.scm

index 8b6db391ed1cce09c188a84ea0b804a31fc26ca6..103470e518b762aeb4d78b1e72b7c2f0a967fc7f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-imap.scm,v 1.131 2000/06/30 17:09:29 cph Exp $
+;;; $Id: imail-imap.scm,v 1.132 2000/06/30 17:19:53 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
 ;;;
                      (dynamic-wind
                       (lambda () unspecific)
                       (lambda ()
+                        (reset-imap-connection connection)
                         (set-imap-connection-port! connection port)
                         (set-imap-connection-greeting!
                          connection
                            (if (imap:response:ok? response)
                                (imap:response:response-text-string response)
                                response)))
-                        (reset-imap-connection connection)
                         (imap:command:capability connection)
                         (if (not
                              (memq 'IMAP4REV1
                         (imap:response:response-text-string response))))))
        (if (eq? (imap-connection-delimiter connection) 'UNKNOWN)
            (begin
-             (imap:command:list connection "" "inbox")
+             (set-imap-connection-delimiter!
+              connection
+              (imap:response:list-delimiter
+               (car (imap:command:list connection "" "inbox"))))
              (if (memq 'NAMESPACE (imap-connection-capabilities connection))
-                 (imap:command:namespace connection))))
+                 (set-imap-connection-namespace!
+                  connection
+                  (imap:command:namespace connection)))))
        #t)))
 \f
 (define (close-imap-connection connection)
   (imap:command:no-response connection 'CAPABILITY))
 
 (define (imap:command:namespace connection)
-  (imap:command:no-response connection 'NAMESPACE))
+  (imap:command:single-response imap:response:namespace? connection
+                               'NAMESPACE))
 
 (define (imap:command:login connection user-id pass-phrase)
   ((imail-ui:message-wrapper "Logging in as " user-id)
          (imap:response:capabilities response))
         #f)
        ((imap:response:namespace? response)
-        (set-imap-connection-namespace! connection response)
-        #f)
+        #t)
        ((imap:response:list? response)
-        (set-imap-connection-delimiter!
-         connection
-         (imap:response:list-delimiter response))
         (eq? command 'LIST))
        ((imap:response:lsub? response)
         (eq? command 'LSUB))