Gnus development mailing list
 help / color / mirror / Atom feed
* pop3+ssl
       [not found] <E1Ef3cI-0006Nl-00@quimby.gnus.org>
@ 2005-11-24  0:21 ` Katsumi Yamaoka
  2005-11-24  1:19   ` pop3+ssl Katsumi Yamaoka
  2005-11-24 12:01   ` pop3+ssl Dave Love
  0 siblings, 2 replies; 10+ messages in thread
From: Katsumi Yamaoka @ 2005-11-24  0:21 UTC (permalink / raw)
  Cc: ding

>>>>> In <E1Ef3cI-0006Nl-00@quimby.gnus.org> Dave Love wrote:

>     Date: Thursday, November 24, 2005 @ 00:01:30
>   Author: cvs
>     Path: /usr/local/cvsroot/gnus/lisp

> Modified: pop3.el

> (pop3-authentication-scheme): Clarify doc.
> (open-tls-stream, starttls-open-stream): Autoload.
> (pop3-stream-type): New.
> (pop3-open-server): Use it.

In pop3-open-server, for what purpose is `while' used?  If it is
intended to run cyclically, it seems to lack some conditions or
other.

		  ;; 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")
			       (delete-region (point-min) (point))
			     (pop3-quit process)
			     (error "POP SSL connexion failed"))))

I cannot try it practically since I have no pop3 server which
supports ssl, though.



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

* Re: pop3+ssl
  2005-11-24  0:21 ` pop3+ssl Katsumi Yamaoka
@ 2005-11-24  1:19   ` Katsumi Yamaoka
  2005-11-24  9:22     ` pop3+ssl Katsumi Yamaoka
  2005-11-24 12:03     ` pop3+ssl Dave Love
  2005-11-24 12:01   ` pop3+ssl Dave Love
  1 sibling, 2 replies; 10+ messages in thread
From: Katsumi Yamaoka @ 2005-11-24  1:19 UTC (permalink / raw)
  Cc: ding

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

>>>>> In <b4msltmyjxi.fsf_-_@jpl.org> Katsumi Yamaoka wrote:

> In pop3-open-server, for what purpose is `while' used?  If it is
> intended to run cyclically, it seems to lack some conditions or
> other.

In addition, `pop3-open-server' should also recognize a string
as a port number.  See the `mail-sources' variable.  I use "110"
for it, which causes an error.


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

--- pop3.el~	2005-11-23 23:34:42 +0000
+++ pop3.el	2005-11-24 01:16:11 +0000
@@ -222,7 +222,8 @@
       (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 "995")))) ; pop3s
 	      (let ((process (open-tls-stream "POP" (current-buffer)
 					      mailhost port)))
 		(when process

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

* Re: pop3+ssl
  2005-11-24  1:19   ` pop3+ssl Katsumi Yamaoka
@ 2005-11-24  9:22     ` Katsumi Yamaoka
  2005-11-24 13:40       ` pop3+ssl Dave Love
  2005-11-24 23:01       ` pop3+ssl Katsumi Yamaoka
  2005-11-24 12:03     ` pop3+ssl Dave Love
  1 sibling, 2 replies; 10+ messages in thread
From: Katsumi Yamaoka @ 2005-11-24  9:22 UTC (permalink / raw)
  Cc: ding

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

>>>>> In <b4mek56yha1.fsf@jpl.org> Katsumi Yamaoka wrote:

> In addition, `pop3-open-server' should also recognize a string
> as a port number.  See the `mail-sources' variable.  I use "110"
> for it, which causes an error.

I realized it depends on the platform whether
`open-network-stream' allows a string which specifies a port
*number* for the fourth argument.  For instance, both of the
following two forms work in the Fedora Core 4 system:

(delete-process
 (open-network-stream "POP" (current-buffer) "popserver" 110))

(delete-process
 (open-network-stream "POP" (current-buffer) "popserver" "110"))

However, in the Solaris 2.6 system, the latter form cannot be
used.  When we use a string for the fourth argument, it should
be a service name like "pop3".  This suggests that we should use
only an integer for a port number or a string for a service name.

But now I use "110", not 110 in the Fedora Core 4 system.  It is
because it should work with all the Emacsen that Gnus supports,
and XEmacs 21.4.17 which I'd built in the Fedora Core 4 system
doesn't allow an integer for the fourth argument of
`open-network-stream'.  It is obviously a bug, I found right now
thanks to some Japanese folks.

Finally, I replace the patch that I sent last with this:


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

--- pop3.el~	2005-11-23 23:34:42 +0000
+++ pop3.el	2005-11-24 09:20:25 +0000
@@ -222,7 +222,7 @@
       (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"))))
 	      (let ((process (open-tls-stream "POP" (current-buffer)
 					      mailhost port)))
 		(when process

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

* Re: pop3+ssl
  2005-11-24  0:21 ` pop3+ssl Katsumi Yamaoka
  2005-11-24  1:19   ` pop3+ssl Katsumi Yamaoka
@ 2005-11-24 12:01   ` Dave Love
  2005-11-24 23:01     ` pop3+ssl Katsumi Yamaoka
  1 sibling, 1 reply; 10+ messages in thread
From: Dave Love @ 2005-11-24 12:01 UTC (permalink / raw)
  Cc: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> In pop3-open-server, for what purpose is `while' used?  If it is
> intended to run cyclically, it seems to lack some conditions or
> other.

`delete-region' returns nil, but I guess for clarity it should be
wrapped in (progn ... nil).

> I cannot try it practically since I have no pop3 server which
> supports ssl, though.

As far as I remember, I tested a Gnus 5.11 version for pop3s against
Gmail and starttls against MS Exchange, with both gnutls and openssl
client programs, but I was a while.  I hoped others would test it
better and fix it if necessary if it was installed.

The TLS stuff is pretty horrible, though.  I'd hope to be able to open
the stream without having to worry about what is output before the
protocol bits you're interested in, and to have return values
indicating whether the connexion has been established securely.



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

* Re: pop3+ssl
  2005-11-24  1:19   ` pop3+ssl Katsumi Yamaoka
  2005-11-24  9:22     ` pop3+ssl Katsumi Yamaoka
@ 2005-11-24 12:03     ` Dave Love
  1 sibling, 0 replies; 10+ messages in thread
From: Dave Love @ 2005-11-24 12:03 UTC (permalink / raw)
  Cc: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> In addition, `pop3-open-server' should also recognize a string
> as a port number.  See the `mail-sources' variable.  I use "110"
> for it, which causes an error.

Sorry yes, it shouldn't error out on a string.  However, as far as I
know, the string form for the port should be a service name, as for
`open-network-stream', so the test should be for `995' or `"pop3s"'.
I'll fix it later unless someone else does it first.



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

* Re: pop3+ssl
  2005-11-24  9:22     ` pop3+ssl Katsumi Yamaoka
@ 2005-11-24 13:40       ` Dave Love
  2005-11-24 23:01       ` pop3+ssl Katsumi Yamaoka
  1 sibling, 0 replies; 10+ messages in thread
From: Dave Love @ 2005-11-24 13:40 UTC (permalink / raw)
  Cc: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> I realized it depends on the platform whether
> `open-network-stream' allows a string which specifies a port
> *number* for the fourth argument.

I don't know why that is, but the Emacs doc says it is the name of the
service or an integer port number.

> Finally, I replace the patch that I sent last with this:

Good, thanks.  That's what I meant in my earlier reply.



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

* Re: pop3+ssl
  2005-11-24  9:22     ` pop3+ssl Katsumi Yamaoka
  2005-11-24 13:40       ` pop3+ssl Dave Love
@ 2005-11-24 23:01       ` Katsumi Yamaoka
  2005-11-25 18:21         ` pop3+ssl Dave Love
  1 sibling, 1 reply; 10+ messages in thread
From: Katsumi Yamaoka @ 2005-11-24 23:01 UTC (permalink / raw)
  Cc: ding

>>>>> In <b4m3blms8n2.fsf@jpl.org> Katsumi Yamaoka wrote:

> --- pop3.el~	2005-11-23 23:34:42 +0000
> +++ pop3.el	2005-11-24 09:20:25 +0000
> @@ -222,7 +222,7 @@
>        (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"))))
>  	      (let ((process (open-tls-stream "POP" (current-buffer)
>  					      mailhost port)))
>  		(when process

Installed.



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

* Re: pop3+ssl
  2005-11-24 12:01   ` pop3+ssl Dave Love
@ 2005-11-24 23:01     ` Katsumi Yamaoka
  2005-11-25 18:26       ` pop3+ssl Dave Love
  0 siblings, 1 reply; 10+ messages in thread
From: Katsumi Yamaoka @ 2005-11-24 23:01 UTC (permalink / raw)
  Cc: ding

>>>>> In <rzqbr0aqmos.fsf@albion.dl.ac.uk> Dave Love wrote:

> Katsumi Yamaoka <yamaoka@jpl.org> writes:

>> In pop3-open-server, for what purpose is `while' used?  If it is
>> intended to run cyclically, it seems to lack some conditions or
>> other.

> `delete-region' returns nil, but I guess for clarity it should be
> wrapped in (progn ... nil).

A certain version of pop3.el does the following:

	(while (and (memq (process-status process) '(open run))
		    (goto-char (point-max))
		    (forward-line -1)
		    (not (looking-at "+OK")))
	  (accept-process-output process TIMEOUT)
	  (sit-for 1))

Where `TIMEOUT' is 1.0 for "windows-nt\\|os/2\\|emx\\|cygwin",
0.1 for others by default.  I'm not sure but it might have been
necessary for the slow connection.

>> I cannot try it practically since I have no pop3 server which
>> supports ssl, though.



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

* Re: pop3+ssl
  2005-11-24 23:01       ` pop3+ssl Katsumi Yamaoka
@ 2005-11-25 18:21         ` Dave Love
  0 siblings, 0 replies; 10+ messages in thread
From: Dave Love @ 2005-11-25 18:21 UTC (permalink / raw)
  Cc: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> Installed.

Ah, I thought you had already done it.  However, I realized that
tls.el won't cope with service names, despite what the doc says, since
gnutls-cli doesn't.  I'll do something about that later.



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

* Re: pop3+ssl
  2005-11-24 23:01     ` pop3+ssl Katsumi Yamaoka
@ 2005-11-25 18:26       ` Dave Love
  0 siblings, 0 replies; 10+ messages in thread
From: Dave Love @ 2005-11-25 18:26 UTC (permalink / raw)
  Cc: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> A certain version of pop3.el does the following:
>
> 	(while (and (memq (process-status process) '(open run))
> 		    (goto-char (point-max))
> 		    (forward-line -1)
> 		    (not (looking-at "+OK")))
> 	  (accept-process-output process TIMEOUT)
> 	  (sit-for 1))
>
> Where `TIMEOUT' is 1.0 for "windows-nt\\|os/2\\|emx\\|cygwin",
> 0.1 for others by default.  I'm not sure but it might have been
> necessary for the slow connection.

I don't understand why that is relevant.  `pop3-read-timeout' is used
by `pop3-accept-process-output', though it makes no sense for it to
depend on the client system as it does.  (Not that it's the only thing
in pop3.el which doesn't or didn't make sense...)

The trouble with this loop and the similar ones elsewhere is that they
don't actually time out if they don't get the expected output from the
network process.



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

end of thread, other threads:[~2005-11-25 18:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E1Ef3cI-0006Nl-00@quimby.gnus.org>
2005-11-24  0:21 ` pop3+ssl Katsumi Yamaoka
2005-11-24  1:19   ` pop3+ssl Katsumi Yamaoka
2005-11-24  9:22     ` pop3+ssl Katsumi Yamaoka
2005-11-24 13:40       ` pop3+ssl Dave Love
2005-11-24 23:01       ` pop3+ssl Katsumi Yamaoka
2005-11-25 18:21         ` pop3+ssl Dave Love
2005-11-24 12:03     ` pop3+ssl Dave Love
2005-11-24 12:01   ` pop3+ssl Dave Love
2005-11-24 23:01     ` pop3+ssl Katsumi Yamaoka
2005-11-25 18:26       ` pop3+ssl Dave Love

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).