From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/59839 Path: main.gmane.org!not-for-mail From: Juergen Kreileder Newsgroups: gmane.emacs.gnus.general Subject: Re: Three problems with multiple IMAP accounts (patch for 2 of 3) Date: Fri, 18 Feb 2005 14:44:45 +0100 Organization: Blackdown Java-Linux Team Message-ID: <87is4q0ype.fsf@blackdown.de> References: <87wtt76edw.fsf@blackdown.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1108734395 17474 80.91.229.2 (18 Feb 2005 13:46:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 18 Feb 2005 13:46:35 +0000 (UTC) Original-X-From: ding-owner+M8379@lists.math.uh.edu Fri Feb 18 14:46:34 2005 Original-Received: from malifon.math.uh.edu ([129.7.128.13] ident=mail) by ciao.gmane.org with esmtp (Exim 4.43) id 1D28Sh-00067t-FG for ding-account@gmane.org; Fri, 18 Feb 2005 14:46:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1D28RJ-0005ez-00; Fri, 18 Feb 2005 07:45:01 -0600 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1D28RA-0005er-00 for ding@lists.math.uh.edu; Fri, 18 Feb 2005 07:44:52 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1D28R5-0006T7-4H for ding@lists.math.uh.edu; Fri, 18 Feb 2005 07:44:47 -0600 Original-Received: from news by quimby.gnus.org with local (Exim 3.35 #1 (Debian)) id 1D28R4-0004Eg-00 for ; Fri, 18 Feb 2005 14:44:46 +0100 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 121 Original-NNTP-Posting-Host: p508ecd7f.dip0.t-ipconnect.de Original-X-Trace: quimby.gnus.org 1108734286 15427 80.142.205.127 (18 Feb 2005 13:44:46 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Fri, 18 Feb 2005 13:44:46 +0000 (UTC) X-PGP-Key: http://blackhole.pca.dfn.de:11371/pks/lookup?op=get&search=0x730A28A5 X-PGP-Fingerprint: 7C19 D069 9ED5 DC2E 1B10 9859 C027 8D5B 730A 28A5 Mail-Copies-To: nobody X-Bender: Bender's a genius! User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:L38uPPNZiXemFnopifIp2FCx1f4= X-Spam-Score: -4.9 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu X-MailScanner-From: ding-owner+m8379@lists.math.uh.edu X-MailScanner-To: ding-account@gmane.org Xref: main.gmane.org gmane.emacs.gnus.general:59839 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:59839 Juergen Kreileder writes: > Problem 1: Excessive reconnecting > ========== This was caused by comparing imap-state with 'select instead of 'selected. I've attached a patch which seems to fix that and problem 3. So this just leaves: > Problem 2: Agent confusion > ========== > Sometimes the agent confuses the two IMAP accounts. The consequence > is that new mail doesn't show up anymore, or it shows up on the > wrong account. Entering a group also shows the contents from the > group with the same name on the other account. To get things > working again, I have to delete ~/News/agent/. Fix for problems 1 and 3: --- /usr/share/emacs/site-lisp/gnus/lisp/imap.el 2005-02-16 12:30:12.000000000 +0100 +++ ./imap.el 2005-02-18 14:24:12.000000000 +0100 @@ -1123,7 +1123,7 @@ password is remembered in the buffer." (with-current-buffer (or buffer (current-buffer)) (if (not (eq imap-state 'nonauth)) (or (eq imap-state 'auth) - (eq imap-state 'select) + (eq imap-state 'selected) (eq imap-state 'examine)) (make-local-variable 'imap-username) (make-local-variable 'imap-password) --- /usr/share/emacs/site-lisp/gnus/lisp/nnimap.el 2005-02-16 12:30:12.000000000 +0100 +++ ./nnimap.el 2005-02-18 14:23:17.000000000 +0100 @@ -826,7 +826,7 @@ If EXAMINE is non-nil the group is selec (or (and nnimap-server-buffer (imap-opened nnimap-server-buffer) (if (with-current-buffer nnimap-server-buffer - (memq imap-state '(auth select examine))) + (memq imap-state '(auth selected examine))) t (imap-close nnimap-server-buffer) (nnimap-open-connection server))) @@ -989,8 +989,11 @@ function is generally only called when G (defun nnimap-update-unseen (group &optional server) "Update the unseen count in `nnimap-mailbox-info'." (gnus-sethash - (gnus-group-prefixed-name group server) - (let ((old (gnus-gethash-safe (gnus-group-prefixed-name group server) + (gnus-group-prefixed-name group (gnus-server-to-method + (format "nnimap:%s" server))) + (let ((old (gnus-gethash-safe (gnus-group-prefixed-name + group (gnus-server-to-method + (format "nnimap:%s" server))) nnimap-mailbox-info))) (list (nth 0 old) (nth 1 old) (imap-mailbox-status group 'unseen nnimap-server-buffer) @@ -1098,7 +1101,9 @@ function is generally only called when G (dolist (group groups) (gnus-message 9 "nnimap: Quickly checking mailbox %s" group) (add-to-list (if (gnus-gethash-safe - (gnus-group-prefixed-name group server) + (gnus-group-prefixed-name + group (gnus-server-to-method + (format "nnimap:%s" server))) nnimap-mailbox-info) 'asyncgroups 'slowgroups) @@ -1111,20 +1116,26 @@ function is generally only called when G new old) (when (imap-ok-p (imap-wait-for-tag tag nnimap-server-buffer)) (if (or (not (string= - (nth 0 (gnus-gethash (gnus-group-prefixed-name - group server) - nnimap-mailbox-info)) + (nth 0 (gnus-gethash + (gnus-group-prefixed-name + group (gnus-server-to-method + (format "nnimap:%s" server))) + nnimap-mailbox-info)) (imap-mailbox-get 'uidvalidity group nnimap-server-buffer))) (not (string= - (nth 1 (gnus-gethash (gnus-group-prefixed-name - group server) - nnimap-mailbox-info)) + (nth 1 (gnus-gethash + (gnus-group-prefixed-name + group (gnus-server-to-method + (format "nnimap:%s" server))) + nnimap-mailbox-info)) (imap-mailbox-get 'uidnext group nnimap-server-buffer)))) (push (list group) slowgroups) (insert (nth 3 (gnus-gethash (gnus-group-prefixed-name - group server) + group (gnus-server-to-method + (format "nnimap:%s" + server))) nnimap-mailbox-info)))))))) (dolist (group slowgroups) (if nnimap-retrieve-groups-asynchronous @@ -1144,7 +1155,8 @@ function is generally only called when G (insert str) (when nnimap-retrieve-groups-asynchronous (gnus-sethash - (gnus-group-prefixed-name group server) + (gnus-group-prefixed-name + group (gnus-server-to-method (format "nnimap:%s" server))) (list (or (imap-mailbox-get 'uidvalidity group nnimap-server-buffer) (imap-mailbox-status = Juergen -- Juergen Kreileder, Blackdown Java-Linux Team http://www.blackdown.org/java-linux/java2-status/