Gnus development mailing list
 help / color / mirror / Atom feed
From: Kevin Greiner <kgreiner@xpediantsolutions.com>
Subject: Re: nnimap, gnus-agent and `/' as a subfolder separator
Date: Wed, 09 Apr 2003 19:18:40 -0500	[thread overview]
Message-ID: <u1y0b6w7z.fsf@xpediantsolutions.com> (raw)
In-Reply-To: <vw3r88c59j1.fsf@informatik.uni-tuebingen.de>

Eric,
I'm assuming that you mentioned nnmail-use-long-file-names because you
debugged the code enough to localize the error.  Thanks.

Eric Knauel <knauel@informatik.uni-tuebingen.de> writes:

> Hi,
>
> The gnus-agent of Oort Gnus 0.17 seems to be confused when `/' is used
> as a subfolder separator on IMAP servers. I'm not sure whether this is
> a bug:
>
> I subscribed some nnimap groups,
> e.g. `nnimap+webmail.macnews.de:macnews/cocoa', accessing them in
> `Plugged mode' works fine, so does fetching the articles with
> gnus-agent `J s':
>
> ,----
> | [knauel@albert cocoa] pwd
> | /Users/knauel/.gnus/News/agent/nnimap/webmail.macnews.de/macnews/cocoa
> | [knauel@albert cocoa] ls
> | 1     2     3     cocoa
> `----

The function that I provide (see below) will not return this path.
You'll need to rename it to
/Users/knauel/.gnus/News/agent/nnimap/webmail.macnews.de/macnews_cocoa

> However, if I try to access this group in `Unplugged mode' this will
> happen:
>
> ,----
> | Signaling: (error "Couldn't request group nnimap+webmail.macnews.de:macnews/cocoa: Invalid group (no such directory)")
> |   signal(error ("Couldn't request group nnimap+webmail.macnews.de:macnews/cocoa: Invalid group (no such directory)"))
> |   cerror("Couldn't request group %s: %s" "nnimap+webmail.macnews.de:macnews/cocoa" "Invalid group (no such directory)")
> |   apply(cerror "Couldn't request group %s: %s" ("nnimap+webmail.macnews.de:macnews/cocoa" "Invalid group (no such directory)"))
> |   error("Couldn't request group %s: %s" "nnimap+webmail.macnews.de:macnews/cocoa" "Invalid group (no such directory)")
> |   gnus-select-newsgroup("nnimap+webmail.macnews.de:macnews/cocoa" nil nil)
> |   gnus-summary-read-group-1("nnimap+webmail.macnews.de:macnews/cocoa" nil t nil nil nil)
> |   gnus-summary-read-group("nnimap+webmail.macnews.de:macnews/cocoa" nil t nil nil nil nil)
> |   gnus-group-read-group(nil t)
> |   gnus-group-select-group(nil)
> |   gnus-topic-select-group(nil)
> |   call-interactively(gnus-topic-select-group)
> `----
>
> I suppose that gnus searches for the mail files in the wrong directory
> or gnus-agent creates the mail folder in the wrong directory. 


The agent should use a path similar to that used by the backend.  That
would appear to indicate that the agent should use 'macnews_cocoa'
rather than 'macnews/cocoa'.


> By looking at the function `nnmail-group-pathname' in nnmail.el I
> found out that it returns
> `/Users/knauel/.gnus/Mail/nnml/macnews_cocoa' in this case.  If I `ln
> -s' that directory to the actual directory created by gnus-agent fetch
> ---it works fine.  

You shouldn't link the nnml directory to the agent.  Doing so means
that both the nnml backend and the agent will try to manipulate the
same local files.  Both components believe that they have exclusive
control over these files so this could be trouble.

You've obviously read the code.  I could use a second opinion.  I've
concluded that nnmail-group-pathname doesn't use
nnmail-use-long-file-names as expected (at least as I would expected).
The problem is that nnmail-group-pathname first converts periods (.)
into underscores (_). It then checks nnmail-use-long-file-names and,
if it is null, converts periods (.) into slashes (/).  But what's the
point? By this time, no periods should remain in the group name.


> However, sometimes (I couldn't figure out why or when) gnus searches
> these groups at
> `/Users/knauel/.gnus/News/agent/nnimap/webmail.macnews.de', which is
> quite correct, but it can't find the subfolder `macnews/cocoa' in this
> directory.  It's looking for `macnews_cocoa' there, so if make another
> link there, it'll work.  That's very confusing. ;-)
>
> BTW I'm using (setq nnmail-use-long-file-names t) in my gnus.el.

Yes, nnmail-use-long-file-names appears to be the problem.

Let's see if this function fixes your problem.

(defun gnus-agent-group-path (group)
  "Translate GROUP into a file name."
  (nnheader-translate-file-chars
   (nnheader-replace-duplicate-chars-in-string
    (nnheader-replace-chars-in-string 
     (gnus-group-real-name group)
     ?/ ?_)
    ?. ?_)))

You can either replace the original in gnus-agent.el or simply eval
this form after loading gnus-agent.

Kevin



  parent reply	other threads:[~2003-04-10  0:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-09  9:01 Eric Knauel
2003-04-09 23:06 ` Danny Siu
2003-04-10  0:18 ` Kevin Greiner [this message]
2003-04-10 14:47   ` Eric Knauel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u1y0b6w7z.fsf@xpediantsolutions.com \
    --to=kgreiner@xpediantsolutions.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).