Gnus development mailing list
 help / color / mirror / Atom feed
* Connecting to cyrus using nnimap-stream type shell
@ 2002-04-19 15:26 Steinar Bang
  2002-04-19 15:35 ` Simon Josefsson
  0 siblings, 1 reply; 8+ messages in thread
From: Steinar Bang @ 2002-04-19 15:26 UTC (permalink / raw)


I'm trying to connect to a cyrus imapd using nnimap-stream shell, with
ssh as the underlying transport.

The secondary server entry is
      (nnimap "doohan"
		(nnimap-address "doohan.somewhere.org")
		(nnimap-stream shell))

(address anonymized to protect the innocent)

The user name on the client machine is "sba", the user name on doohan
is "sb".  I have an ~/.authinfo containing

machine doohan.somewhere.org login sb
machine doohan login sb

So far, I have tried

(add-to-list 'imap-shell-program
	     "ssh %s telnet localhost imap")

then

(add-to-list 'imap-shell-program
	     "ssh -l %l %s telnet localhost imap")

then

(add-to-list 'imap-shell-program
	     "ssh -l sb %s telnet localhost imap")

then

(add-to-list 'imap-shell-program
	     "ssh -l sb doohan.somewhere.org telnet localhost imap")

but Gnus is still hanging, trying to connect to doohan on startup.

I have verified that the command 
	ssh -l sb doohan.somewhere.org telnet localhost imap
works from the command line, with the response:

Trying 127.0.0.1...
Connected to doohan.
Escape character is '^]'.
* OK doohan Cyrus IMAP4 v1.5.19 server ready

Is it the stuff preceeding "* OK" the imap backend croaks on?

Thanx!


- Steinar



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

* Re: Connecting to cyrus using nnimap-stream type shell
  2002-04-19 15:26 Connecting to cyrus using nnimap-stream type shell Steinar Bang
@ 2002-04-19 15:35 ` Simon Josefsson
  2002-04-22  9:29   ` Steinar Bang
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Josefsson @ 2002-04-19 15:35 UTC (permalink / raw)
  Cc: ding

On Fri, 19 Apr 2002, Steinar Bang wrote:

> The user name on the client machine is "sba", the user name on doohan
> is "sb".  I have an ~/.authinfo containing

I'm not sure .authinfo is used by the shell stream, I think it assumes 
that you've set things up so that no tty passwords are needed.

> I have verified that the command 
> 	ssh -l sb doohan.somewhere.org telnet localhost imap
> works from the command line, with the response:
> 
> Trying 127.0.0.1...
> Connected to doohan.
> Escape character is '^]'.
> * OK doohan Cyrus IMAP4 v1.5.19 server ready
> 
> Is it the stuff preceeding "* OK" the imap backend croaks on?

Generic advice: edebug `imap-shell-open' to find out what's happening.

Specific advice:  Try patch:

--- imap.el.~6.36.~	Sun Mar 10 15:30:31 2002
+++ imap.el	Fri Apr 19 17:33:38 2002
@@ -692,7 +692,8 @@
 	(when process
 	  (while (and (memq (process-status process) '(open run))
 		      (set-buffer buffer) ;; XXX "blue moon" nntp.el bug
-		      (goto-char (point-min))
+		      (goto-char (point-max))
+		      (forward-line -1)
 		      (not (imap-parse-greeting)))
 	    (accept-process-output process 1)
 	    (sit-for 1))





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

* Re: Connecting to cyrus using nnimap-stream type shell
  2002-04-19 15:35 ` Simon Josefsson
@ 2002-04-22  9:29   ` Steinar Bang
  2002-04-22 10:52     ` Simon Josefsson
  0 siblings, 1 reply; 8+ messages in thread
From: Steinar Bang @ 2002-04-22  9:29 UTC (permalink / raw)


>>>>> Simon Josefsson <jas@extundo.com>:

> Generic advice: edebug `imap-shell-open' to find out what's happening.

Is that (edebug-defun 'imap-shell-open)? 

> Specific advice:  Try patch:

Here's an extract from 'C-h l':

Opening nnimap server on doohan...failed
Quit trying to open server
Waiting for response from doohan.somewhere.org...done
imap: Opening IMAP connection with `ssh -l sb doohan.somewhere.org telnet localhost imap'...done
imap: Opening IMAP connection with `ssh -l sb doohan.somewhere.org telnet localhost imap'...
imap: Connecting to doohan.somewhere.org...
Opening nnimap server on doohan...
Reading active file from doohan via nnimap...

It seems to become stuck in the 
 "Waiting for response from doohan.somewhere.org...done"
line.  The rest of the output is after I took a C-g.








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

* Re: Connecting to cyrus using nnimap-stream type shell
  2002-04-22  9:29   ` Steinar Bang
@ 2002-04-22 10:52     ` Simon Josefsson
  2002-06-25  5:57       ` Steinar Bang
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Josefsson @ 2002-04-22 10:52 UTC (permalink / raw)
  Cc: ding

On Mon, 22 Apr 2002, Steinar Bang wrote:

> >>>>> Simon Josefsson <jas@extundo.com>:
> 
> > Generic advice: edebug `imap-shell-open' to find out what's happening.
> 
> Is that (edebug-defun 'imap-shell-open)? 

More or less.  I usually locate the function first and then do M-x
edebug-defun RET on it.

> > Specific advice:  Try patch:
> 
> Here's an extract from 'C-h l':
> 
> Opening nnimap server on doohan...failed
> Quit trying to open server
> Waiting for response from doohan.somewhere.org...done
> imap: Opening IMAP connection with `ssh -l sb doohan.somewhere.org telnet localhost imap'...done
> imap: Opening IMAP connection with `ssh -l sb doohan.somewhere.org telnet localhost imap'...
> imap: Connecting to doohan.somewhere.org...
> Opening nnimap server on doohan...
> Reading active file from doohan via nnimap...
> 
> It seems to become stuck in the 
>  "Waiting for response from doohan.somewhere.org...done"
> line.  The rest of the output is after I took a C-g.

Ok.  The problem is finding the server greeting then, possibly it is
messed up by other things (CRLF, telnet greeting, etc).  Edebugging the
function and peeking in the *nnimap* server buffer should give information
to why the regexp doesn't match the text in the buffer.




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

* Re: Connecting to cyrus using nnimap-stream type shell
  2002-04-22 10:52     ` Simon Josefsson
@ 2002-06-25  5:57       ` Steinar Bang
  2002-06-25  9:01         ` Simon Josefsson
  0 siblings, 1 reply; 8+ messages in thread
From: Steinar Bang @ 2002-06-25  5:57 UTC (permalink / raw)


>>>>> Simon Josefsson <jas@extundo.com>:

>> It seems to become stuck in the 
>> "Waiting for response from doohan.somewhere.org...done"
>> line.  The rest of the output is after I took a C-g.

> Ok.  The problem is finding the server greeting then, possibly it is
> messed up by other things (CRLF, telnet greeting, etc).  Edebugging the
> function and peeking in the *nnimap* server buffer should give information
> to why the regexp doesn't match the text in the buffer.

OK.  Edebugging imap-shell-open:

imap.el:
	(when process
=>	  (while (and (memq (process-status process) '(open run))

buffer:
Trying 127.0.0.1...
Connected to doohan.
Escape character is '^]'.
* OK doohan Cyrus IMAP4 v1.5.19 server ready

imap.el:
		      (goto-char (point-max))
=>		      (forward-line -1)

buffer: cursor is now at the start of the line:
* OK doohan Cyrus IMAP4 v1.5.19 server ready

imap.el:
    (if done
	(progn
	  (message "imap: Opening IMAP connection with `%s'...done" cmd)
	  done)
      (message "imap: Opening IMAP connection with `%s'...failed" cmd)
=>     nil)))
(skips out of the function, I think)

buffer:
* CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS X-NON-HIERARCHICAL-RENAME NO_ATOMIC_RENAME UNSELECT X-NETSCAPE
1 OK Completed
(cursor on the first line)

And then it is stuck in 
 "Waiting for response from doohan.somewhere.org...done"
Nothing seems to happen, and C-g starts it working on the next server
to be opened.





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

* Re: Connecting to cyrus using nnimap-stream type shell
  2002-06-25  5:57       ` Steinar Bang
@ 2002-06-25  9:01         ` Simon Josefsson
  2002-06-25 12:41           ` Steinar Bang
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Josefsson @ 2002-06-25  9:01 UTC (permalink / raw)
  Cc: ding

Steinar Bang <sb@dod.no> writes:

> imap.el:
> 	(when process
> =>	  (while (and (memq (process-status process) '(open run))
>
> buffer:
> Trying 127.0.0.1...
> Connected to doohan.
> Escape character is '^]'.
> * OK doohan Cyrus IMAP4 v1.5.19 server ready
>
> imap.el:
> 		      (goto-char (point-max))
> =>		      (forward-line -1)
>
> buffer: cursor is now at the start of the line:
> * OK doohan Cyrus IMAP4 v1.5.19 server ready
>
> imap.el:
>     (if done
> 	(progn
> 	  (message "imap: Opening IMAP connection with `%s'...done" cmd)
> 	  done)
>       (message "imap: Opening IMAP connection with `%s'...failed" cmd)
> =>     nil)))
> (skips out of the function, I think)

That means `done' was set to nil, no?  It is set using 

	  (when (memq (process-status process) '(open run))
	    (setq done process)))))

a few lines above, what did edebug say on that?  Did process have the
correct value?  Perhaps the process had died?  Perhaps it was in some
other state than open or run?  Which one?




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

* Re: Connecting to cyrus using nnimap-stream type shell
  2002-06-25  9:01         ` Simon Josefsson
@ 2002-06-25 12:41           ` Steinar Bang
  2002-06-28 12:35             ` Steinar Bang
  0 siblings, 1 reply; 8+ messages in thread
From: Steinar Bang @ 2002-06-25 12:41 UTC (permalink / raw)


>>>>> Simon Josefsson <jas@extundo.com>:

>> Steinar Bang <sb@dod.no> writes:
>> imap.el:
>>     (if done
>> 	(progn
>> 	  (message "imap: Opening IMAP connection with `%s'...done" cmd)
>> 	  done)
>>       (message "imap: Opening IMAP connection with `%s'...failed" cmd)
>> =>     nil)))
>> (skips out of the function, I think)

> That means `done' was set to nil, no? 

No, I don't think so: it's the "done" line that is printed out.  And
"(if done" skips down to the first message.

The cursor stays on the last line for two presses of `n', before it
skips out of the function.

> It is set using 

> 	  (when (memq (process-status process) '(open run))
> 	    (setq done process)))))

> a few lines above, what did edebug say on that? 

I get
	Result: nil
in the minibuffer, at the end of the clause you listed.  But I don't
see how this means that done is nil, since the "(if done" picks the
"(progn" at the start.

What's left on the stack at the end of the above clause?  Is it the
result of the "when" or is it the result of the "setq".

Hmno... `C-h v done RET' gives me:
Value: #<process "imap" pid 20891 state:run>

> Did process have the correct value? 

I don't know.  Here's the value
Value: #<process "imap" pid 20891 state:run>

> Perhaps the process had died? 

Process 20891 (the ssh process) is still running, as far as I can
tell.  There's also a telnet process running on the imap server
machine. 

> Perhaps it was in some other state than open or run?  Which one?

It's in "run", I think.



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

* Re: Connecting to cyrus using nnimap-stream type shell
  2002-06-25 12:41           ` Steinar Bang
@ 2002-06-28 12:35             ` Steinar Bang
  0 siblings, 0 replies; 8+ messages in thread
From: Steinar Bang @ 2002-06-28 12:35 UTC (permalink / raw)


>>>>> Steinar Bang <sb@dod.no>:

>>>>> Simon Josefsson <jas@extundo.com>:
>>> Steinar Bang <sb@dod.no> writes:
>>> imap.el:
>>>    (if done
>>>     (progn
>>> 	 (message "imap: Opening IMAP connection with `%s'...done" cmd)
>>>               done)
>>>     (message "imap: Opening IMAP connection with `%s'...failed" cmd)
>>> =>            nil)))
>>> (skips out of the function, I think)

>> That means `done' was set to nil, no? 

> No, I don't think so: it's the "done" line that is printed out.  And
> "(if done" skips down to the first message.

> The cursor stays on the last line for two presses of `n', before it
> skips out of the function.

But maybe it doesn't skip out of the function?  Shouldn't an `n' at
the end of the function take me to the calling context for the
function? 

That doesn't seem to be happening.  After the final `n', everything
freezes until I press `C-g'.



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

end of thread, other threads:[~2002-06-28 12:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-19 15:26 Connecting to cyrus using nnimap-stream type shell Steinar Bang
2002-04-19 15:35 ` Simon Josefsson
2002-04-22  9:29   ` Steinar Bang
2002-04-22 10:52     ` Simon Josefsson
2002-06-25  5:57       ` Steinar Bang
2002-06-25  9:01         ` Simon Josefsson
2002-06-25 12:41           ` Steinar Bang
2002-06-28 12:35             ` Steinar Bang

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