From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84772 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: [gmane.emacs.gnus.user] Re: One folder in local imap not seen Date: Wed, 13 Aug 2014 18:43:50 +0800 Message-ID: <87a978vfdl.fsf@ericabrahamsen.net> References: <87mwb9wb4o.fsf@ericabrahamsen.net> <87vbpwvjj0.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1407926418 29253 80.91.229.3 (13 Aug 2014 10:40:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2014 10:40:18 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M33015@lists.math.uh.edu Wed Aug 13 12:40:11 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XHVyR-0000QG-TG for ding-account@gmane.org; Wed, 13 Aug 2014 12:40:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1XHVyC-0000gb-4m; Wed, 13 Aug 2014 05:39:52 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1XHVyA-0000gO-QV for ding@lists.math.uh.edu; Wed, 13 Aug 2014 05:39:50 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1XHVy9-0001xH-HG for ding@lists.math.uh.edu; Wed, 13 Aug 2014 05:39:50 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1XHVy7-0005py-Ix for ding@gnus.org; Wed, 13 Aug 2014 12:39:47 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XHVy6-0000Id-95 for ding@gnus.org; Wed, 13 Aug 2014 12:39:46 +0200 Original-Received: from 124.78.11.230 ([124.78.11.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Aug 2014 12:39:46 +0200 Original-Received: from eric by 124.78.11.230 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Aug 2014 12:39:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 139 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 124.78.11.230 User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:pfGeDiunzyFTD0XY4uXMYFPLfyA= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84772 Archived-At: Rainer M Krug writes: > Eric Abrahamsen writes: > >> Rainer M Krug writes: >> >>> <#secure method=pgpmime mode=sign> >>> Eric Abrahamsen writes: >>> >>>> Rainer M Krug writes: >>>> >>>>> I am posting this here now, as I did not get any reponse on the >>>>> gnus.user list. >>>>> >>>>> I have one folder in my local imap, which I see when I telnet into the >>>>> local imap server, which is seen by e.g. Mail (OSX), but not seen by >>>>> gnus. I have added the local imap server again as an additional server, >>>>> but I also couldn't see it there. It is not killed as far as I can see. >>>> >>>> One good way of seeing where things are going wrong is to edebug >>>> `nnimap-get-groups'. When you go into the *Server* buffer and list the >>>> groups in your local imap server, you'll be able to see the results of >>>> the LIST command, and then see how Gnus parses those results. That >>>> should get you closer to the source of the problem. >>> >>> OK - yes, it does. But it does not help me. When I cycle through the >>> 'nnimap-get-groups' function, I can't make any sense out of the results, >>> but I realized that in the (while ...) loop (see the code for reference below), the folder >>> ...[Mailbox].Later does not occur. As I can't make any sense out of the >>> previous results. >>> >>> Any further tips how I can debug this? >> >> The early part of the function is just issuing the LIST command to imap, >> and inserting the results into a buffer. Just to make sure that the LIST >> command *isn't* returning your folder, step through `nnimap-get-groups' >> again, and when you get to the second (goto-char (point-min)), hit "e" >> to eval, and tell it (switch-to-buffer (current-buffer)). That should >> make visible a buffer with a name like "#> *nntpd**-44898>". You can see the results of the LIST command there. >> >> If the folder really isn't in that list, then I don't know what to tell >> you -- Gnus should be getting exactly the same results as your local >> telnet experiments. > > OK - they are in the result from the LIST output: > > ,---- > | ... > | * LIST (%HasNoChildren) "." "RMKrugGMAIL.[Gmail].All Mail". > | * LIST (%HasNoChildren) "." RMKrugGMAIL.[Gmail].Bin. > | * LIST (%HasNoChildren) "." RMKrugGMAIL.[Gmail].Drafts. > | * LIST (%HasNoChildren) "." RMKrugGMAIL.[Gmail].Important. > | * LIST (%HasNoChildren) "." RMKrugGMAIL.[Gmail].Sent. > | * LIST (%HasNoChildren) "." "RMKrugGMAIL.[Gmail].Sent Mail". > | * LIST (%HasNoChildren) "." RMKrugGMAIL.[Gmail].Spam. > | * LIST (%HasNoChildren) "." RMKrugGMAIL.[Gmail].Starred. > | * LIST (%HasChildren) "." RMKrugGMAIL.[Mailbox]. > | * LIST (%HasNoChildren) "." RMKrugGMAIL.[Mailbox].Later. > | * LIST (%HasNoChildren) "." "RMKrugGMAIL.[Mailbox].To Buy". > | * LIST (%HasNoChildren) "." "RMKrugGMAIL.[Mailbox].To Download". > | * LIST (%HasNoChildren) "." "RMKrugGMAIL.[Mailbox].To Follow". > | * LIST (%HasNoChildren) "." "RMKrugGMAIL.[Mailbox].To Read". > | * LIST (%HasNoChildren) "." "RMKrugGMAIL.[Mailbox].To Watch". > | * LIST (%HasNoChildren) "." "RMKrugGMAIL.[Mailbox].Wait For Feedback". > | * LIST (%HasNoChildren) "." RMKrugGMAIL.Emacs-macosx. > | * LIST (%HasNoChildren) "." RMKrugGMAIL.INBOX. > | ... > `---- > > But the line with the '.Later' folder is not iterated through in the > while loop. In Gnus, do you see any of the groups above that are *not* quoted? Ie, Important, or Emacs-macosx? A problem I've run into in the past is that Gnus parses the mailbox name using (read (current-buffer)). That's supposed to chomp the whole name in one go, which it does if the mailbox is quoted. But if it isn't quoted, the read just chomps forward until it hits a slash, or a period, or some other character that it considers to delimit a Lisp object. Right now, browsing the group list for any of my Gmail imap accounts, I see this in the list: U 0: [Gmail] U 0: [Gmail] U 0: [Gmail] U 0: [Gmail] Actually, those are my Spam, Trash, and Drafts groups, plus the one "HasChildren" [Gmail] mailbox. They just show up broken in the browse list, I think because of the problem I outlined above. Mind you, I'm actually able to access those groups in the *Group* buffer, I assume because the groups were already entered into my newsrc file. It would be nice if there was a dovecot option to say "quote mailbox names no matter what," but I don't know if there is. I think the spec says the names must be quoted if there's a space in them, but if not it's up to the server. Just to confirm this, would you mind eval'ling this version of nnimap-get-groups, and seeing if it helps? It's an ugly hack from ages ago, that I used when I was having this problem, but then I stopped using it, I don't remember why. It's possible I used it for a while, the groups were entered correctly into my newsrc, and then when I stopped using it it didn't break anything, so I let it go. One manual edit you'll have to make is to add a ^M control character where I've indicated below -- I think it wouldn't survive the email trip. (defun nnimap-get-groups () (erase-buffer) (let ((sequence (nnimap-send-command "LIST \"\" \"*\"")) groups) (nnimap-wait-for-response sequence) (subst-char-in-region (point-min) (point-max) ?\\ ?% t) (goto-char (point-min)) (nnimap-unfold-quoted-lines) (goto-char (point-min)) (while (search-forward "* LIST " nil t) (let ((flags (read (current-buffer))) (separator (read (current-buffer))) (group (buffer-substring-no-properties (progn (skip-chars-forward " \"") (point)) (progn (move-end-of-line 1) (skip-chars-backward " \"") ; add a C-q C-m inside this string (point))))) (unless (member '%NoSelect flags) (push (utf7-decode (if (stringp group) group (format "%s" group)) t) groups)))) (nreverse groups)))