Gnus development mailing list
 help / color / mirror / Atom feed
* nnimap support for "NAMESPACE" (prefix "INBOX." on courier-imap)
@ 2004-02-27 18:38 Chris Shenton
  2004-02-27 19:42 ` nnimap support for "NAMESPACE" (prefix "INBOX." on Simon Josefsson
  2004-03-01 20:57 ` Ted Zlatanov
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Shenton @ 2004-02-27 18:38 UTC (permalink / raw)


I'm "No Gnus v0.2" with a couple of courier-imap servers which use an
IMAP namespace of "INBOX.":

  * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE NEWHORSE GRAPPA UMAMI LAPHROIG] Courier-IMAP ready. Copyright 1998-2003 Double Precision, Inc.  See COPYING for distribution information.
  2 login USERNAME PASSW0RD
  2 OK LOGIN Ok.
  3 namespace
  * NAMESPACE (("INBOX." ".")) NIL (("shared." "."))
  3 OK NAMESPACE completed.

Currently, when ever I want to refert to a server mailbox name (e.g.,
to move from my main inbox to some other) I have to use something like:

  nnimap+pectopah:INBOX.list.ding

Gnus defaults the part up to the colon, which is usally good, but I
have to type that INBOX. thing every time.   Is there a way to tell
Gnus to find out the namespace from the server and use this as a
prefix so I don't have to? 

  http://www.lysator.liu.se/~forsberg/docs/Gnus_and_Courier.xml

has some code which hides this display from the user, but IMHO that's
not the right thing -- gnus can figure out the prefix from the server.

Gnus *info* mentions "A note on namespaces" about mutant UoW IMAP
server behavior but doesn't say anything about setting one manually or
automatically.

Does Gnus have a way to determine this from the server? Have it
configured manually? use it when referring to mailbox names, for
retrieval, creation, moving, etc?

Thanks.



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

* Re: nnimap support for "NAMESPACE" (prefix "INBOX." on
  2004-02-27 18:38 nnimap support for "NAMESPACE" (prefix "INBOX." on courier-imap) Chris Shenton
@ 2004-02-27 19:42 ` Simon Josefsson
  2004-03-01 20:57 ` Ted Zlatanov
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Josefsson @ 2004-02-27 19:42 UTC (permalink / raw)
  Cc: ding

Chris Shenton <chris@shenton.org> writes:

> I'm "No Gnus v0.2" with a couple of courier-imap servers which use an
> IMAP namespace of "INBOX.":
>
>   * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE NEWHORSE GRAPPA UMAMI LAPHROIG] Courier-IMAP ready. Copyright 1998-2003 Double Precision, Inc.  See COPYING for distribution information.
>   2 login USERNAME PASSW0RD
>   2 OK LOGIN Ok.
>   3 namespace
>   * NAMESPACE (("INBOX." ".")) NIL (("shared." "."))
>   3 OK NAMESPACE completed.
>
> Currently, when ever I want to refert to a server mailbox name (e.g.,
> to move from my main inbox to some other) I have to use something like:
>
>   nnimap+pectopah:INBOX.list.ding
>
> Gnus defaults the part up to the colon, which is usally good, but I
> have to type that INBOX. thing every time.   Is there a way to tell
> Gnus to find out the namespace from the server and use this as a
> prefix so I don't have to? 

You mean, you want it to default to the private namespace by default?
It is not clear this is always the best default (some people move mail
from private folders to shared folders), but I agree it would be nice
to offer this as a feature.

You do know about tab completion, right?  'I<TAB>' is sufficient for
me.  Further, the next time you have to enter the mailbox, there is
command line history, so you can retrieve the earlier value, and edit
it -- for example, I often do <UP><M-backspace> and write a new
mailbox name, then the INBOX prefix comes from an earlier value
prompt.

> Does Gnus have a way to determine this from the server? Have it
> configured manually? use it when referring to mailbox names, for
> retrieval, creation, moving, etc?

I have installed the following, at least it will allow you to hook in
your own function that return the default prefix used.

2004-02-27  Simon Josefsson  <jas@extundo.com>

	* gnus-sum.el (gnus-move-group-prefix-function): Add, default to
	gnus-group-real-prefix.
	(gnus-summary-move-article): Use it, instead of
	gnus-group-real-prefix.

Index: gnus-sum.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v
retrieving revision 7.20
retrieving revision 7.21
diff -u -p -r7.20 -r7.21
--- gnus-sum.el	14 Feb 2004 00:29:45 -0000	7.20
+++ gnus-sum.el	27 Feb 2004 19:40:52 -0000	7.21
@@ -422,6 +422,13 @@ this variable specifies group names."
 			 (cons :value ("" "") regexp (repeat string))
 			 (sexp :value nil))))
 
+(defcustom gnus-move-group-prefix-function 'gnus-group-real-prefix
+  "Function used to compute default prefix for article move/copy/etc prompts.
+The function should take one argument, a group name, and return a
+string with the suggested prefix."
+  :group 'gnus-summary-mail
+  :type 'function)
+
 (defcustom gnus-unread-mark ?           ;Whitespace
   "*Mark used for unread articles."
   :group 'gnus-summary-marks
@@ -8873,7 +8880,8 @@ ACTION can be either `move' (the default
   (let ((articles (gnus-summary-work-articles n))
 	(prefix (if (gnus-check-backend-function
 		     'request-move-article gnus-newsgroup-name)
-		    (gnus-group-real-prefix gnus-newsgroup-name)
+		    (funcall gnus-move-group-prefix-function
+			     gnus-newsgroup-name)
 		  ""))
 	(names '((move "Move" "Moving")
 		 (copy "Copy" "Copying")



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

* Re: nnimap support for "NAMESPACE" (prefix "INBOX." on
  2004-02-27 18:38 nnimap support for "NAMESPACE" (prefix "INBOX." on courier-imap) Chris Shenton
  2004-02-27 19:42 ` nnimap support for "NAMESPACE" (prefix "INBOX." on Simon Josefsson
@ 2004-03-01 20:57 ` Ted Zlatanov
  1 sibling, 0 replies; 3+ messages in thread
From: Ted Zlatanov @ 2004-03-01 20:57 UTC (permalink / raw)
  Cc: ding

I also would like to find the namespace prefix and separator from the
IMAP server.  Right now I do this in order to have working splitting:

(setq
 nnimap-split-rule '(
		     ("lifelogs" ("INBOX" nnimap-split-fancy)) ; UW IMAP
		     ("sysblade0" ("INBOX" nnimap-courier-split-fancy))) ; Courier

 nnimap-courier-split-fancy '(|
; ... omitted ...
			      (: gnus-registry-split-fancy-with-parent)
			      (: spam-split 'spam-use-regex-headers)
; ... omitted ...
			      (: spam-split 'spam-use-blackholes)
			      ;; default mailbox
			      "INBOX.mail")

 nnimap-split-inbox "INBOX"
 nnimap-split-fancy '(|
; ... omitted ...
		      (: gnus-registry-split-fancy-with-parent)
		      (: spam-split 'spam-use-regex-headers)
; ... omitted ...
		      (: spam-split)
		      ;; default mailbox
		      "mail")
 )

(defun nnimap-courier-split-fancy ()
  (let ((nnimap-split-fancy nnimap-courier-split-fancy)
	(spam-split-group "INBOX.spam"))
    (nnimap-split-fancy)))

Note I set the spam-split-group also, because it's "spam" by default.

With the namespace prefix this would be simpler.  I would still have
separate split rules because the servers have different purposes, but
I wouldn't have to set the spam-split-group explicitly, and I
wouldn't have different mailbox names everywhere.

That being said, I think the Courier model of having a namespace
prefix for private vs. shared vs. public groups is very clean, and I
like it very much.

Ted



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

end of thread, other threads:[~2004-03-01 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-27 18:38 nnimap support for "NAMESPACE" (prefix "INBOX." on courier-imap) Chris Shenton
2004-02-27 19:42 ` nnimap support for "NAMESPACE" (prefix "INBOX." on Simon Josefsson
2004-03-01 20:57 ` Ted Zlatanov

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