? PATCH Index: ChangeLog =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 7.1656 diff -u -r7.1656 ChangeLog --- ChangeLog 7 Nov 2007 07:42:35 -0000 7.1656 +++ ChangeLog 14 Nov 2007 21:10:09 -0000 @@ -1,3 +1,8 @@ +2007-11-14 Denys Duchier + + * pop3.el (pop3-open-server): accept and process data more robustly at + connexion start to avoid spurious "POP SSL connexion failed" errors. + 2007-11-05 Reiner Steib * message.el (message-citation-line-function) Index: pop3.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/pop3.el,v retrieving revision 7.26 diff -u -r7.26 pop3.el --- pop3.el 4 Oct 2007 18:51:28 -0000 7.26 +++ pop3.el 14 Nov 2007 21:10:11 -0000 @@ -241,16 +241,20 @@ mailhost port))) (when process ;; There's a load of info printed that needs deleting. - (while (when (memq (process-status process) '(open run)) - (pop3-accept-process-output process) - (goto-char (point-max)) - (forward-line -1) - (if (looking-at "\\+OK") - (progn - (delete-region (point-min) (point)) - nil) - (pop3-quit process) - (error "POP SSL connexion failed")))) + (let ((again 't)) + ;; repeat until + ;; - either we received the +OK line + ;; - or accept-process-output timed out without getting anything + (while (and again (setq again (memq (process-status process) '(open run)))) + (setq again (pop3-accept-process-output process)) + (goto-char (point-max)) + (forward-line -1) + (cond ((looking-at "\\+OK") + (setq again nil) + (delete-region (point-min) (point))) + ((not again) + (pop3-quit-process) + (error "POP SSL connexion failed"))))) process))) ((eq pop3-stream-type 'starttls) ;; gnutls-cli, openssl don't accept service names