Gnus development mailing list
 help / color / mirror / Atom feed
* patch for "POP SSL connexion failed"
@ 2007-11-13 20:40 Denys Duchier
  2007-11-14  8:47 ` Leo
  2007-11-16 20:07 ` rahed
  0 siblings, 2 replies; 7+ messages in thread
From: Denys Duchier @ 2007-11-13 20:40 UTC (permalink / raw)
  To: ding

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




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: patch for "POP SSL connexion failed"
  2007-11-13 20:40 patch for "POP SSL connexion failed" Denys Duchier
@ 2007-11-14  8:47 ` Leo
  2007-11-14 12:07   ` Katsumi Yamaoka
  2007-11-16 20:07 ` rahed
  1 sibling, 1 reply; 7+ messages in thread
From: Leo @ 2007-11-14  8:47 UTC (permalink / raw)
  To: ding

On 2007-11-13 20:40 +0000, Denys Duchier wrote:
> 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:

I have been complaining¹ about this bug for a long long time. Thanks for
the patch.

Footnotes: 
¹  Archived-At: <http://permalink.gmane.org/gmane.emacs.gnus.general/65415>
-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

          Use the best OS -- http://www.fedoraproject.org/




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: patch for "POP SSL connexion failed"
  2007-11-14  8:47 ` Leo
@ 2007-11-14 12:07   ` Katsumi Yamaoka
  2007-11-14 15:28     ` Leo
  2007-11-14 21:15     ` Denys Duchier
  0 siblings, 2 replies; 7+ messages in thread
From: Katsumi Yamaoka @ 2007-11-14 12:07 UTC (permalink / raw)
  To: Denys Duchier; +Cc: ding

>>>>> Leo wrote:
> On 2007-11-13 20:40 +0000, Denys Duchier wrote:
>> 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:

> I have been complaining¹ about this bug for a long long time. Thanks for
> the patch.

The patch looks harmless also for people who have no problem with
pop3.  Do you have signed a paper for FSF?  Otherwise, since it
seems to be able to regard as a tiny change, do you wish to go
that way?  Please write a ChangeLog entry by yourself, anyway.

Regards,



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: patch for "POP SSL connexion failed"
  2007-11-14 12:07   ` Katsumi Yamaoka
@ 2007-11-14 15:28     ` Leo
  2007-11-14 21:15     ` Denys Duchier
  1 sibling, 0 replies; 7+ messages in thread
From: Leo @ 2007-11-14 15:28 UTC (permalink / raw)
  To: ding

On 2007-11-14 12:07 +0000, Katsumi Yamaoka wrote:
>>>>>> Leo wrote:
>> On 2007-11-13 20:40 +0000, Denys Duchier wrote:
>>> 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:
>
>> I have been complaining¹ about this bug for a long long time. Thanks for
>> the patch.
>
> The patch looks harmless also for people who have no problem with
> pop3. 

It will be good to know if the problem is with the pop3 server. I uses
pop3 server of gmail.com.

> Do you have signed a paper for FSF?  Otherwise, since it seems to be
> able to regard as a tiny change, do you wish to go that way?  Please
> write a ChangeLog entry by yourself, anyway.
>
> Regards,

-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

          Use the best OS -- http://www.fedoraproject.org/




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: patch for "POP SSL connexion failed"
  2007-11-14 12:07   ` Katsumi Yamaoka
  2007-11-14 15:28     ` Leo
@ 2007-11-14 21:15     ` Denys Duchier
  2007-11-14 22:16       ` Katsumi Yamaoka
  1 sibling, 1 reply; 7+ messages in thread
From: Denys Duchier @ 2007-11-14 21:15 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> Do you have signed a paper for FSF?  Otherwise, since it seems to be
> able to regard as a tiny change, do you wish to go that way?

I have not signed FSF papers and this is such a minuscule contribution I
am hoping it is not necessary to do the paperwork.

>  Please write a ChangeLog entry by yourself, anyway.

here you go:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix pop3-open-server --]
[-- Type: text/x-patch, Size: 2025 bytes --]

? 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 <denys.duchier@univ-orleans.fr>
+
+	* 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  <Reiner.Steib@gmx.de>
 
 	* 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

[-- Attachment #3: Type: text/plain, Size: 18 bytes --]


Cheers,

--Denys

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: patch for "POP SSL connexion failed"
  2007-11-14 21:15     ` Denys Duchier
@ 2007-11-14 22:16       ` Katsumi Yamaoka
  0 siblings, 0 replies; 7+ messages in thread
From: Katsumi Yamaoka @ 2007-11-14 22:16 UTC (permalink / raw)
  To: Denys Duchier; +Cc: ding

>>>>> Denys Duchier wrote:
> Katsumi Yamaoka <yamaoka@jpl.org> writes:

>> Do you have signed a paper for FSF?  Otherwise, since it seems to be
>> able to regard as a tiny change, do you wish to go that way?

> I have not signed FSF papers and this is such a minuscule contribution I
> am hoping it is not necessary to do the paperwork.

>>  Please write a ChangeLog entry by yourself, anyway.

> here you go:

Okay.  I've installed your *tiny change* in the Gnus trunk.
Thank you for the improvement.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: patch for "POP SSL connexion failed"
  2007-11-13 20:40 patch for "POP SSL connexion failed" Denys Duchier
  2007-11-14  8:47 ` Leo
@ 2007-11-16 20:07 ` rahed
  1 sibling, 0 replies; 7+ messages in thread
From: rahed @ 2007-11-16 20:07 UTC (permalink / raw)
  To: ding

Denys Duchier <denys.duchier@univ-orleans.fr> writes:

> 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

Shouldn't the line
> +			     (pop3-quit-process)

read
> +			     (pop3-quit process)
?

When I start gnus with this patch it freezes with a message in the
minibuffer:

Opening TLS connection to 'pop.gmail.com'...done

and a trace of POP session to pop.gmail.com buffer has a line
+OK Gpop ready for requests from ...

Apparently it waits for user/passwd.
Could someone elaborate?

-- 
Radek




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-11-16 20:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-13 20:40 patch for "POP SSL connexion failed" Denys Duchier
2007-11-14  8:47 ` Leo
2007-11-14 12:07   ` Katsumi Yamaoka
2007-11-14 15:28     ` Leo
2007-11-14 21:15     ` Denys Duchier
2007-11-14 22:16       ` Katsumi Yamaoka
2007-11-16 20:07 ` rahed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).