Gnus development mailing list
 help / color / mirror / Atom feed
* Three problems with multiple IMAP accounts
@ 2005-02-17  3:42 Juergen Kreileder
  2005-02-17  4:12 ` Mark Plaksin
  2005-02-18 13:44 ` Three problems with multiple IMAP accounts (patch for 2 of 3) Juergen Kreileder
  0 siblings, 2 replies; 4+ messages in thread
From: Juergen Kreileder @ 2005-02-17  3:42 UTC (permalink / raw)


Hi,

I have a few problems with multiple IMAP accounts:

Problem 1: Excessive reconnecting 
========== 

If I do 'g' with just one IMAP account I see:

,----
| Reading active file from Local via nnimap...
| nnimap: Checking mailboxes...done
`----

With two IMAP accounts this changes to:

,----
| Reading active file from Remote via nnimap...
| Opening nnimap server on Remote...
| Opening nnimap server on Remote...done
| nnimap: Checking mailboxes...done
| Reading active file from Local via nnimap...
| Opening nnimap server on Local...
| Opening nnimap server on Local...done
| nnimap: Checking mailboxes...done
`----

Note the "Opening nnimap ..." lines, they don't show up in the
one-account case.

Now if I enter and immediately leave a group on one of the accounts
(in this case the "Local" account) and do 'g' again, I get:

,----
| Reading active file from Remote via nnimap...
| Opening nnimap server on Remote...
| Opening nnimap server on Remote...done
| nnimap: Checking mailboxes...done
| Reading active file from Local via nnimap...
| Opening nnimap server on Local...
| imap: Connecting to server.jknet...
| imap: Opening SSL connection with `openssl s_client -cert /home/gnustest/.SSL/mailclient.cert -key /home/gnustest/.SSL/mailclient.key -quiet -ssl3 -connect %s:%p'...done
| Waiting for response from server.jknet...done
| imap: Authenticating using CRAM-MD5...done
| Opening nnimap server on Local...done
| nnimap: Checking mailboxes...done
`----

Ie. it closed the perfectly good connection and immediately opened a
new one!  This close&reconnect thing happens each time I leave a group
and do 'g'.
I can work around this reconnecting issue by setting nnimap-dont-close
to nil.  But I suspect the real problem is somewhere else, why does it
take the "Opening nnimap..." path with more than one account?


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


Problem 3: Unprefixed names in nnimap-mailbox-info
=========

nnimap-mailbox-info contains un-prefixed group names.  This slows down
'g' in the group buffer when there are groups with the same name on
both IMAP accounts.

This patch fixes the problem for me:

--- /usr/share/emacs/site-lisp/gnus/lisp/nnimap.el	2005-02-16 12:30:12.000000000 +0100
+++ ./nnimap.el	2005-02-16 14:21:18.000000000 +0100
@@ -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/



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

end of thread, other threads:[~2005-02-18 13:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-17  3:42 Three problems with multiple IMAP accounts Juergen Kreileder
2005-02-17  4:12 ` Mark Plaksin
2005-02-17  5:31   ` Juergen Kreileder
2005-02-18 13:44 ` Three problems with multiple IMAP accounts (patch for 2 of 3) Juergen Kreileder

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