diff options
| author | Yuri Karaban | 2010-11-19 11:25:09 -0500 |
|---|---|---|
| committer | Chong Yidong | 2010-11-19 11:25:09 -0500 |
| commit | 4b320a0146c7c068079b756624579eef6580b503 (patch) | |
| tree | 81cb8757d447bdeeeb7a9700e677bca3d585863e | |
| parent | b916cbefa481920a49eac03c7025693f38afc882 (diff) | |
| download | emacs-4b320a0146c7c068079b756624579eef6580b503.tar.gz emacs-4b320a0146c7c068079b756624579eef6580b503.zip | |
* pop3.el (pop3-open-server): Read server greeting before starting TLS negotiation.
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/pop3.el | 21 |
2 files changed, 16 insertions, 10 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index e6024b3e95e..7350cf97f50 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-11-19 Yuri Karaban <tech@askold.net> (tiny change) | ||
| 2 | |||
| 3 | * pop3.el (pop3-open-server): Read server greeting before starting TLS | ||
| 4 | negotiation. | ||
| 5 | |||
| 1 | 2010-10-12 Juanma Barranquero <lekktu@gmail.com> | 6 | 2010-10-12 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * nnmail.el (nnmail-fancy-expiry-targets): Fix typo in docstring. | 8 | * nnmail.el (nnmail-fancy-expiry-targets): Fix typo in docstring. |
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el index b3012b4b198..b445b8979ea 100644 --- a/lisp/gnus/pop3.el +++ b/lisp/gnus/pop3.el | |||
| @@ -259,21 +259,22 @@ Returns the process associated with the connection." | |||
| 259 | ;; gnutls-cli, openssl don't accept service names | 259 | ;; gnutls-cli, openssl don't accept service names |
| 260 | (if (equal port "pop3") | 260 | (if (equal port "pop3") |
| 261 | (setq port 110)) | 261 | (setq port 110)) |
| 262 | (let ((process (starttls-open-stream "POP" (current-buffer) | 262 | ;; Delay STLS until server greeting is read (Bug#7438). |
| 263 | mailhost (or port 110)))) | 263 | (starttls-open-stream "POP" (current-buffer) |
| 264 | (pop3-send-command process "STLS") | 264 | mailhost (or port 110))) |
| 265 | (let ((response (pop3-read-response process t))) | 265 | (t |
| 266 | (if (and response (string-match "+OK" response)) | ||
| 267 | (starttls-negotiate process) | ||
| 268 | (pop3-quit process) | ||
| 269 | (error "POP server doesn't support starttls"))) | ||
| 270 | process)) | ||
| 271 | (t | ||
| 272 | (open-network-stream "POP" (current-buffer) mailhost port)))) | 266 | (open-network-stream "POP" (current-buffer) mailhost port)))) |
| 273 | (let ((response (pop3-read-response process t))) | 267 | (let ((response (pop3-read-response process t))) |
| 274 | (setq pop3-timestamp | 268 | (setq pop3-timestamp |
| 275 | (substring response (or (string-match "<" response) 0) | 269 | (substring response (or (string-match "<" response) 0) |
| 276 | (+ 1 (or (string-match ">" response) -1))))) | 270 | (+ 1 (or (string-match ">" response) -1))))) |
| 271 | (when (eq pop3-stream-type 'starttls) | ||
| 272 | (pop3-send-command process "STLS") | ||
| 273 | (let ((response (pop3-read-response process t))) | ||
| 274 | (if (and response (string-match "+OK" response)) | ||
| 275 | (starttls-negotiate process) | ||
| 276 | (pop3-quit process) | ||
| 277 | (error "POP server doesn't support starttls")))) | ||
| 277 | process))) | 278 | process))) |
| 278 | 279 | ||
| 279 | ;; Support functions | 280 | ;; Support functions |