From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/34522 Path: main.gmane.org!not-for-mail From: "Steven E. Harris" Newsgroups: gmane.emacs.gnus.general Subject: Re: nnimap RFC2342 support (IMAP4 Namespace) Date: 01 Feb 2001 11:29:02 -0800 Organization: Tenzing Communications Inc. Sender: owner-ding@hpc.uh.edu Message-ID: <87ae86fbi9.fsf@torus.tenzing.com> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035170434 30854 80.91.224.250 (21 Oct 2002 03:20:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:20:34 +0000 (UTC) Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by mailhost.sclp.com (Postfix) with ESMTP id 0E196D049D for ; Thu, 1 Feb 2001 14:36:44 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.3/8.9.3) with ESMTP id NAC13341; Thu, 1 Feb 2001 13:34:04 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 01 Feb 2001 13:33:24 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id NAA00287 for ; Thu, 1 Feb 2001 13:33:13 -0600 (CST) Original-Received: from ts-exch01.tenzing.com (ts-exch01.tenzing.com [63.115.0.25]) by mailhost.sclp.com (Postfix) with ESMTP id 06833D049D for ; Thu, 1 Feb 2001 14:33:42 -0500 (EST) Original-Received: from torus (63.115.3.217 [63.115.3.217]) by ts-exch01.tenzing.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id D49BG7Y8; Thu, 1 Feb 2001 11:33:42 -0800 Original-Received: from seh by torus with local (Exim 3.12 #1 (Debian)) id 14OPPi-0005kF-00 for ; Thu, 01 Feb 2001 11:29:02 -0800 Original-To: ding@gnus.org User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Capitol Reef) Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 73 Xref: main.gmane.org gmane.emacs.gnus.general:34522 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:34522 Simon Josefsson writes: > [1] NAMESPACE is only a way for the server to indicate what kind of > mailbox hierarchies there are. All it does is saying "All your > private mailboxes begin with INBOX", "All your newsgroups begin with > #news", "All shared folders on this server begin with bb." Well, not quite. It also lets you know what the hierarchy delimiter is. Given that, Gnus could see that foo/bar is really the same as INBOX.foo.bar on another server, provided that it stores these paths as lists rather than literal strings. That, or it remembers the hierarchy delimiter so that it could split, then reassemble a folder name on a new server with a different delimiter. Here's some experimental code I was playing around with: ================================================== (defconst sep-display ":") (defconst sep-orig "/") (defconst sep-new ".") (defun tokenize-string (str start sep) (if (string-match sep str start) (cons (substring str start (match-beginning 0)) (tokenize-string str (match-end 0) sep)) (list (substring str start)))) (defun pedantic-replace (str sep-old sep-new) (mapconcat 'identity (tokenize-string str 0 sep-old) sep-new)) (defun get-current-ns-sep () sep-orig) (defun get-new-ns-sep () sep-new) (defun make-folder-display-name (folder) (pedantic-replace folder (get-current-ns-sep) sep-display)) (defun migrate-folder-name (folder) (pedantic-replace folder (get-current-ns-sep) (get-new-ns-sep))) (make-folder-display-name "foo/bar/baz") (migrate-folder-name "foo/bar/baz") ================================================== The `pedantic-replace' function isn't the most efficient way to replace one string with another, but it shows that we could be storing the IMAP folder hierarchy as a list that can be split and joined without much trouble. I didn't take masking the leading "INBOX" into account, but I imagine this would involve storing some special symbol at the beginning of the list that would have a corresponding string (possibly empty) for each server. Also, note the `make-folder-display-name' function, which would let the user concoct her own way of showing a folder name, independent of the underlying server's representation. -- Steven E. Harris :: steven.harris@tenzing.com Tenzing :: http://www.tenzing.com