+1999-05-17 Daiki Ueno <daiki@kiss.kake.info.waseda.ac.jp>
+ Tsukamoto Tetsuo <czkmt@remus.dti.ne.jp>
+
+ * lisp/gnus.el (gnus-revision-number): Increment to 06.
+
+ * lisp/mail-source.el (mail-source-keyword-map): New keyword
+ :connection for pop. It is introduced to enable SSL connection.
+ (mail-source-fetch-pop): Use it to bind `pop3-connection-type'.
+
+ * lisp/pop3.el : Add an autoload for `open-ssl-stream' defined in
+ `ssl'.
+ (pop3-connection-type, pop3-ssl-program-arguments): New variables.
+ (pop3-open-ssl-stream-1, pop3-open-ssl-stream): New functions.
+ (pop3-open-server): Call the latter when `pop3-connection-type' is
+ ssl.
+
1999-05-17 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus.el (gnus-revision-number): Increment to 05.
(:program)
(:function)
(:password)
+ (:connection)
(:authentication password))
(maildir
(:path "~/Maildir/new/")))
(pop3-mailhost server)
(pop3-port port)
(pop3-authentication-scheme
- (if (eq authentication 'apop) 'apop 'pass)))
+ (if (eq authentication 'apop) 'apop 'pass))
+ (pop3-connection-type connection))
(save-excursion (pop3-movemail mail-source-crash-box))))))
(if result
(prog1
"*POP3 mailhost.")
(defvar pop3-port 110
"*POP3 port.")
+(defvar pop3-connection-type nil
+ "*POP3 connection type.")
(defvar pop3-password-required t
"*Non-nil if a password is required when connecting to POP server.")
(defvar pop3-read-point nil)
(defvar pop3-debug nil)
+(eval-and-compile
+ (autoload 'open-ssl-stream "ssl"))
+
+(defvar pop3-ssl-program-arguments
+ '("-quiet")
+ "Arguments to be passed to the program `pop3-ssl-program-name'.")
+
(defun pop3-movemail (&optional crashbox)
"Transfer contents of a maildrop to the specified CRASHBOX."
(or crashbox (setq crashbox (expand-file-name "~/.crashbox")))
(setq pop3-read-point (point-min))
)
(setq process
- (open-network-stream-as-binary "POP" process-buffer mailhost port))
+ (cond ((eq pop3-connection-type 'ssl)
+ (pop3-open-ssl-stream "POP" process-buffer mailhost port))
+ (t
+ (open-network-stream-as-binary "POP" process-buffer mailhost port))))
(let ((response (pop3-read-response process t)))
(setq pop3-timestamp
(substring response (or (string-match "<" response) 0)
(+ 1 (or (string-match ">" response) -1)))))
process))
+(defun pop3-open-ssl-stream-1 (name buffer host service extra-arg)
+ (let* ((ssl-program-arguments
+ (` ((,@ pop3-ssl-program-arguments) (, extra-arg)
+ "-connect" (, (format "%s:%d" host service)))))
+ (process (open-ssl-stream name buffer host service)))
+ (when process
+ (with-current-buffer buffer
+ (goto-char (point-min))
+ (while (and (memq (process-status process) '(open run))
+ (goto-char (point-max))
+ (forward-line -1)
+ (not (looking-at "+OK")))
+ (accept-process-output process 1)
+ (sit-for 1))
+ (delete-region (point-min) (point)))
+ (and process (memq (process-status process) '(open run))
+ process))))
+
+(defun pop3-open-ssl-stream (name buffer host service)
+ "Open a SSL connection for a service to a host."
+ (as-binary-process
+ (or (pop3-open-ssl-stream-1 name buffer host service "-ssl3")
+ (pop3-open-ssl-stream-1 name buffer host service "-ssl2"))))
+
;; Support functions
(defun pop3-process-filter (process output)