From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/37913 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: nnimap - not quite there yet? Date: Fri, 17 Aug 2001 21:33:04 +0200 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035173582 18057 80.91.224.250 (21 Oct 2002 04:13:02 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:13:02 +0000 (UTC) Cc: Joe Casadonte , ding-list Return-Path: Return-Path: Original-Received: (qmail 5952 invoked from network); 17 Aug 2001 19:33:14 -0000 Original-Received: from dolk.extundo.com (195.42.214.242) by gnus.org with SMTP; 17 Aug 2001 19:33:14 -0000 Original-Received: from barbar.josefsson.org (slipsten.extundo.com [195.42.214.241]) (authenticated) by dolk.extundo.com (8.11.3/8.11.3) with ESMTP id f7HJXJw01306; Fri, 17 Aug 2001 21:33:19 +0200 Original-To: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai =?iso-8859-1?q?Gro=DFjohann?=) In-Reply-To: (Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "Thu, 09 Aug 2001 23:52:09 +0200") Mail-Copies-To: nobody User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.104 Original-Lines: 123 Xref: main.gmane.org gmane.emacs.gnus.general:37913 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:37913 Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes: >> Example: I added an nntp group and set the level to 3. My >> gnus-activate-level is set to 1. When I run gnus-group-get-new-news >> this new group does not get queried. That's what I'd like to have >> happen with my lower-level IMAP folders. > > It's what should happen automatically. If it doesn't happen, I think > that's a bug in nnimap. I think it's simply that checking active info is fast for nntp and slow for nnimap, so noone has noticed this before -- from `gnus-group-get-new-news': (if (and gnus-read-active-file (not arg)) (progn (gnus-read-active-file) (gnus-get-unread-articles arg)) (let ((gnus-read-active-file (if arg nil gnus-read-active-file))) (gnus-get-unread-articles arg))) (gnus-run-hooks 'gnus-after-getting-new-news-hook) so unless you call `g' with a prefix, it will read the active files. It seems as if it's only `gnus-get-unread-articles' that check the active level, but then it's too late (the active file was already read). This seems to be consistent with how group levels work for me, `1 g' etc works, but setting `gnus-activate-level' to 1 does not. I guess group levels should be used in `gnus-read-active-file*'. Ok, patch below. Please try. >>>> 4) As has been mentioned elsewhere in recent threads, nnimap (and >>>> all of Gnus for that matter) is not terribly fault tolerant. If >>>> a server connection goes down, the connection needs to be >>>> severed manually before it can be reconnected. Again, this is >>>> more of a general Gnus issue, I think, but nnimap seems a bit >>>> more stubborn then nntp. >>> >>> Believe it or not, I never have those problems. When the connection >>> goes down for some reason, Gnus brings it back up. Other than a >>> slight delay, I don't notice anything. >>> >>> Do you use a shell command to access your IMAP servers (ssh, say)? >>> That might be more problematic. >> >> Bingo again. So, not knowing enough about SSH, this is more an SSH >> issue then a Gnus/nnimap issue? > > Hm. One idea might be to use ssh port forwarding. Maybe that helps. > For example, I run ssh like this: > > ssh -f -L 10119:quimby.gnus.org:119 bonny -l grossjoh sleep 3600 > > This means that `telnet localhost 10119' gives me a connection to > quimby.gnus.org which goes through bonny. Ie, the connection from > localhost to bonny is encrypted via ssh, and the connection from bonny > to quimby.gnus.org is in the clear, as required by nntp. This port > forwarding is alive until the command (sleep 3600) terminates. > > Of course, the `sleep 3600' part has a high kludge factor. Not sure > what to do about that. Also, you'd have to arrange for Gnus to start > this on demand. > > There is also an -R option for ssh, which I've never understood. > > But I think that Gnus should provide a feature to check whether the > connection to the remote end has gone down. The idea is like this: > Gnus records the time when it sends a command to the remote host. And > before sending a command, it looks how much time has elapsed since the > last command. If that was more than, say, N seconds, Gnus sends a > no-op command and looks carefully whether the remote end replies as it > should. If the remote end doesn't reply, Gnus takes the connection > down and tries again. I've committed an improvement to the network checking, it should actually work for all native emacs processes now. I don't think emacs can distinguish between a dead ssh connection or a live one if it is invoked in a subshell, but ssh port forwards is ok. --- gnus-start.el.~6.27.~ Fri Aug 17 17:34:19 2001 +++ gnus-start.el Fri Aug 17 21:18:30 2001 @@ -1821,16 +1821,34 @@ ((and (eq gnus-read-active-file 'some) (gnus-check-backend-function 'retrieve-groups (car method)) (not force)) - (let ((newsrc (cdr gnus-newsrc-alist)) + (let* ((newsrc (cdr gnus-newsrc-alist)) (gmethod (gnus-server-get-method nil method)) - groups info) + groups info + (foreignp (and gmethod + (not (gnus-native-method-p gmethod)) + (not (gnus-secondary-method-p method)))) + (level (or gnus-activate-level (1+ gnus-level-subscribed))) + (foreign-level + (min + (cond ((and gnus-activate-foreign-newsgroups + (not (numberp gnus-activate-foreign-newsgroups))) + (1+ gnus-level-subscribed)) + ((numberp gnus-activate-foreign-newsgroups) + gnus-activate-foreign-newsgroups) + (t 0)) + level))) (while (setq info (pop newsrc)) - (when (inline + (when (and + ;; check level on group + (<= (gnus-info-level info) (if foreignp + foreign-level + level)) + (inline (gnus-server-equal (inline (gnus-find-method-for-group (gnus-info-group info) info)) - gmethod)) + gmethod))) (push (gnus-group-real-name (gnus-info-group info)) groups))) (gnus-read-active-file-2 groups method)))