squatter

Christian Schulte cs at schulte.it
Sat Jun 14 18:31:33 EDT 2003


Vittorio Manfredini wrote:

>More information :
>
>squatter is not able to index mailboxes on virtual domain !!
>
>  
>
>they interpret the "." of the domain name as a separator and substitute it !!
>
>example :
>
>su cyrus
>squatter -r -v user/vittorio at example.com
>error opening user.vittorio at example^com: Mailbox does not exist
>
>May be a bug in 2.2 code ??
>
>vittorio
>
>-------------------------------------------------
>This mail sent through IMP: http://horde.org/imp/
>  
>

This patch fixes the problem for me but I have no idea if it is correct!

===================================================================
RCS file: /cvs/src/cyrus/imap/squatter.c,v
retrieving revision 1.5.4.11
diff -u -r1.5.4.11 squatter.c
--- squatter.c	20 May 2003 15:45:53 -0000	1.5.4.11
+++ squatter.c	14 Jun 2003 22:26:37 -0000
@@ -419,6 +419,7 @@
     int rflag = 0;
     int i;
     char buf[MAX_MAILBOX_PATH+1];
+    char newbuf[MAX_MAILBOX_PATH+1];
     struct namespace squat_namespace;
     int r;
 
@@ -479,11 +480,14 @@
     for (i = optind; i < argc; i++) {
         strlcpy(buf, argv[i], sizeof(buf));
 	/* Translate any separators in mailboxname */
-	mboxname_hiersep_tointernal(&squat_namespace, buf, 0);
-	index_me(buf, 0, 0, NULL);
+	//mboxname_hiersep_tointernal(&squat_namespace, buf, 0);
+	/* Handle conversion from the standard namespace to the internal namespace */
+        (*squat_namespace.mboxname_tointernal)(&squat_namespace, buf, NULL, newbuf);
+
+	index_me(newbuf, 0, 0, NULL);
 	if (rflag) {
-	    strlcat(buf, ".*", sizeof(buf));
-	    (*squat_namespace.mboxlist_findall)(&squat_namespace, buf, 1,
+	    strlcat(newbuf, ".*", sizeof(newbuf));
+	    (*squat_namespace.mboxlist_findall)(&squat_namespace, newbuf, 1,
 						0, 0, index_me, NULL);
 	}
     }







More information about the Info-cyrus mailing list