Synch to Oort Gnus.
authoryamaoka <yamaoka>
Fri, 28 Feb 2003 00:42:22 +0000 (00:42 +0000)
committeryamaoka <yamaoka>
Fri, 28 Feb 2003 00:42:22 +0000 (00:42 +0000)
lisp/ChangeLog
lisp/imap.el
lisp/nntp.el

index 290651b..137148f 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-27  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * imap.el (imap-ssl-open): Don't depend on ssl.el.
+       * nntp.el (nntp-open-ssl-stream): Don't depend on ssl.el.
+
 2003-02-26  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * spam.el: add spam-stat-load to gnus-get-new-news-hook
index 0a2daaf..03f9daa 100644 (file)
 (require 'base64)
 
 (eval-and-compile
-  (autoload 'open-ssl-stream "ssl")
   (autoload 'starttls-open-stream "starttls")
   (autoload 'starttls-negotiate "starttls")
   (autoload 'rfc2104-hash "rfc2104")
@@ -589,24 +588,21 @@ If ARGS, PROMPT is used as an argument to `format'."
   (let ((cmds (if (listp imap-ssl-program) imap-ssl-program
                (list imap-ssl-program)))
        cmd done)
-    (condition-case ()
-       (require 'ssl)
-      (error))
     (while (and (not done) (setq cmd (pop cmds)))
       (message "imap: Opening SSL connection with `%s'..." cmd)
-      (let* ((port (or port imap-default-ssl-port))
-            (ssl-program-name shell-file-name)
-            (ssl-program-arguments
-             (list shell-command-switch
-                   (format-spec cmd (format-spec-make
-                                     ?s server
-                                     ?p (number-to-string port)))))
-            process)
-       (when (setq process
-                   (condition-case nil
-                       (as-binary-process
-                        (open-ssl-stream name buffer server port))
-                     (error nil)))
+      (let ((port (or port imap-default-ssl-port))
+           (process-connection-type nil)
+           process)
+       (when (prog1
+                 (setq process (as-binary-process
+                                (start-process
+                                 name buffer shell-file-name
+                                 shell-command-switch
+                                 (format-spec cmd
+                                              (format-spec-make
+                                               ?s server
+                                               ?p (number-to-string port))))))
+               (process-kill-without-query process))
          (with-current-buffer buffer
            (goto-char (point-min))
            (while (and (memq (process-status process) '(open run))
index 526e2fe..6fabd71 100644 (file)
@@ -284,9 +284,15 @@ noticing asynchronous data.")
 (defvar nntp-async-timer nil)
 (defvar nntp-async-process-list nil)
 
+(defvar nntp-ssl-program 
+  "openssl s_client -quiet -ssl3 -connect %s:%p"
+"A string containing commands for SSL connections.
+Within a string, %s is replaced with the server address and %p with
+port number on server.  The program should accept IMAP commands on
+stdin and return responses to stdout.")
+
 (eval-and-compile
-  (autoload 'mail-source-read-passwd "mail-source")
-  (autoload 'open-ssl-stream "ssl"))
+  (autoload 'mail-source-read-passwd "mail-source"))
 
 \f
 
@@ -1213,7 +1219,16 @@ password contained in '~/.nntp-authinfo'."
    "nntpd" buffer nntp-address nntp-port-number))
 
 (defun nntp-open-ssl-stream (buffer)
-  (let ((proc (open-ssl-stream "nntpd" buffer nntp-address nntp-port-number)))
+  (let* ((process-connection-type nil)
+        (proc (as-binary-process
+               (start-process "nntpd" buffer
+                              shell-file-name
+                              shell-command-switch
+                              (format-spec nntp-ssl-program
+                                           (format-spec-make
+                                            ?s nntp-address
+                                            ?p nntp-port-number))))))
+    (process-kill-without-query proc)
     (save-excursion
       (set-buffer buffer)
       (nntp-wait-for-string "^\r*20[01]")
@@ -1793,7 +1808,8 @@ Please refer to the following variables to customize the connection:
        proc)
     (and nntp-pre-command
         (push nntp-pre-command command))
-    (setq proc (apply 'start-process "nntpd" buffer command))
+    (setq proc (as-binary-process
+               (apply 'start-process "nntpd" buffer command)))
     (save-excursion
       (set-buffer buffer)
       (nntp-wait-for-string "^\r*20[01]")
@@ -1866,7 +1882,8 @@ Please refer to the following variables to customize the connection:
          (case-fold-search t)
          proc)
       (and nntp-pre-command (push nntp-pre-command command))
-      (setq proc (apply 'start-process "nntpd" buffer command))
+      (setq proc (as-binary-process
+                 (apply 'start-process "nntpd" buffer command)))
       (when (memq (process-status proc) '(open run))
        (nntp-wait-for-string "^r?telnet")
        (process-send-string proc "set escape \^X\n")