From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65648 Path: news.gmane.org!not-for-mail From: Denys Duchier Newsgroups: gmane.emacs.gnus.general Subject: patch for "POP SSL connexion failed" Date: Tue, 13 Nov 2007 21:40:12 +0100 Message-ID: <87sl39vpzn.fsf@univ-orleans.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195000636 2704 80.91.229.12 (14 Nov 2007 00:37:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2007 00:37:16 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M14146@lists.math.uh.edu Wed Nov 14 01:37:21 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1Is6Fr-0003UO-Ee for ding-account@gmane.org; Wed, 14 Nov 2007 01:37:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Is6EY-0004Ld-8a; Tue, 13 Nov 2007 18:35:58 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Is2Z4-0003Gd-RX for ding@lists.math.uh.edu; Tue, 13 Nov 2007 14:40:54 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1Is2Yy-0003Hz-Rt for ding@lists.math.uh.edu; Tue, 13 Nov 2007 14:40:54 -0600 Original-Received: from smtp28.orange.fr ([80.12.242.100]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Is2Ys-0007f5-00 for ; Tue, 13 Nov 2007 21:40:42 +0100 Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2807.orange.fr (SMTP Server) with ESMTP id 60F4C8000046 for ; Tue, 13 Nov 2007 21:40:13 +0100 (CET) Original-Received: from localhost.localdomain.univ-orleans.fr (AOrleans-157-1-53-42.w90-20.abo.wanadoo.fr [90.20.40.42]) by mwinf2807.orange.fr (SMTP Server) with ESMTP id ECC0E80000AF for ; Tue, 13 Nov 2007 21:40:12 +0100 (CET) X-ME-UUID: 20071113204012969.ECC0E80000AF@mwinf2807.orange.fr User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux) X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65648 Archived-At: I don't know if it was a change in gnus (I did not update in a very long time) or a change in my POP server, but I have been getting something like over 10 failed connexions for every 1 success ever since I cvs up'ed. Here is a fix that seems to work well for me: cvs server: Diffing . 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 13 Nov 2007 20:35:35 -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 --Denys