X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fpop3.el;h=8282f9c50c550172234366ff33cf6d2f9e26f50d;hb=78fb54ccd668ba345d10ac2cc860a79a155d1e13;hp=5fc0e3ad5cf2f4bfeb5a211036bc8269c3f4e552;hpb=5bbd5cb856818da88344a77fa0d28114f9a69310;p=gnus diff --git a/lisp/pop3.el b/lisp/pop3.el index 5fc0e3ad5..8282f9c50 100644 --- a/lisp/pop3.el +++ b/lisp/pop3.el @@ -1,7 +1,7 @@ ;;; pop3.el --- Post Office Protocol (RFC 1460) interface ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -;; 2004, 2005 Free Software Foundation, Inc. +;; 2004, 2005, 2006 Free Software Foundation, Inc. ;; Author: Richard L. Pieri ;; Maintainer: FSF @@ -194,6 +194,7 @@ Shorter values mean quicker response, but are more CPU intensive.") (autoload 'open-tls-stream "tls") (autoload 'starttls-open-stream "starttls") +(autoload 'starttls-negotiate "starttls") ; avoid warning (defcustom pop3-stream-type nil "*Transport security type for POP3 connexions. @@ -202,7 +203,7 @@ SSL/TSL-secured stream) or `starttls' (use the starttls mechanism to turn on TLS security after opening the stream). However, if this is nil, `ssl' is assumed for connexions to port 995 (pop3s)." - :version "23.1" ; fixme? + :version "23.0" ;; No Gnus :group 'pop3 :type '(choice (const :tag "Plain" nil) (const :tag "SSL/TLS" ssl) @@ -222,7 +223,11 @@ Returns the process associated with the connection." (setq process (cond ((or (eq pop3-stream-type 'ssl) - (and (not pop3-stream-type) (= port 995))) ; pop3s + (and (not pop3-stream-type) (member port '(995 "pop3s")))) + ;; gnutls-cli, openssl don't accept service names + (if (or (equal port "pop3s") + (null port)) + (setq port 995)) (let ((process (open-tls-stream "POP" (current-buffer) mailhost port))) (when process @@ -232,13 +237,18 @@ Returns the process associated with the connection." (goto-char (point-max)) (forward-line -1) (if (looking-at "\\+OK") - (delete-region (point-min) (point)) + (progn + (delete-region (point-min) (point)) + nil) (pop3-quit process) (error "POP SSL connexion failed")))) process))) ((eq pop3-stream-type 'starttls) + ;; gnutls-cli, openssl don't accept service names + (if (equal port "pop3") + (setq port 110)) (let ((process (starttls-open-stream "POP" (current-buffer) - mailhost port))) + mailhost (or port 110)))) (pop3-send-command process "STLS") (let ((response (pop3-read-response process t))) (if (and response (string-match "+OK" response))