Package: cyrus21-imapd
Severity: wishlist
Tags: patch

hi,

cyrus does not support virtual domains, without adding every domain to
"loginrealms" in imap.conf. Even if I do this, the username have to be
unique over all domains. I have written a small patch to fix this
problem. If applied this is needed in imapd.conf:

virtdomains: yes
robot101mode: yes

I have now this setup running without problems so far.

cu,
Patrick

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (400, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-1-686-smp
Locale: LANG=C, LC_CTYPE=de_DE.ISO-8859-1 (charmap=ISO-8859-1)
--- cyrus21-imapd-2.1.18-orig/imap/imapd.c	2005-03-05 03:17:37.643470000 +0100
+++ cyrus21-imapd-2.1.18/imap/imapd.c	2005-03-05 03:39:39.440406509 +0100
@@ -316,6 +316,7 @@
 			   struct propctx *propctx __attribute__((unused)))
 {
     const char *val;
+    const char *config_virtdomains;
     char *realm;
 
     /* check if remote realm */
@@ -331,11 +332,14 @@
 	    while (*val && !isspace((int) *val)) val++;
 	    while (*val && isspace((int) *val)) val++;
 	}
-	if (!*val) {
+	config_virtdomains = config_getstring("virtdomains","");
+	if(strncasecmp(config_virtdomains,"yes",4)) {
+	 if (!*val) {
 	    sasl_seterror(conn, 0, "cross-realm login %s denied",
 			  auth_identity);
 	    return SASL_BADAUTH;
-	}
+	 }
+	} /* end virtdomains */
     }
 
     imapd_authstate = auth_newstate(auth_identity, NULL);
--- cyrus21-imapd-2.1.18-orig/imap/config.c	2005-03-05 03:17:37.000000000 +0100
+++ cyrus21-imapd-2.1.18/imap/config.c	2005-03-06 21:35:17.472774298 +0100
@@ -479,6 +479,7 @@
     const char *val;
     struct auth_state *authstate;
     int userisadmin = 0;
+    const char *config_virtdomains;
     char *realm;
 
     if(!ctx)
@@ -497,11 +498,14 @@
 	    while (*val && !isspace((int) *val)) val++;
 	    while (*val && isspace((int) *val)) val++;
 	}
-	if (!*val) {
+	config_virtdomains = config_getstring("virtdomains","");
+	if(strncasecmp(config_virtdomains,"yes",4)) {
+	 if (!*val) {
 	    sasl_seterror(conn, 0, "cross-realm login %s denied",
 			  auth_identity);
 	    return SASL_BADAUTH;
-	}
+	 }
+	} /* end virtdomains */
     }
 
     authstate = auth_newstate(auth_identity, NULL);

Reply via email to