Patch to disable referrals

Andrew Morgan morgan at orst.edu
Thu Jun 21 20:41:12 UTC 2007


The attached patch adds a config option to disable referrals from 
frontends to backends.  I don't remember if it applies cleanly to v2.2.13, 
but I am using it with v2.2.13 in production now.

 	Andy
-------------- next part --------------
--- cyrus-imapd-2.2.10.dist/imap/proxyd.c	2004-11-23 09:40:15.000000000 -0800
+++ cyrus-imapd-2.2.10/imap/proxyd.c	2005-01-14 12:50:11.965210408 -0800
@@ -1227,7 +1227,7 @@
     
     /* Cleanup Globals */
     proxyd_cmdcnt = 0;
-    disable_referrals = 0;
+    disable_referrals = config_getswitch(IMAPOPT_PROXYD_DISABLE_MAILBOX_REFERRALS);
     supports_referrals = 0;
     proxyd_userisadmin = 0;
     proxyd_starttls_done = 0;
@@ -2823,6 +2823,10 @@
     prot_printf(proxyd_out, "* CAPABILITY ");
     prot_printf(proxyd_out, CAPABILITY_STRING);
 
+    if (config_getswitch(IMAPOPT_PROXYD_DISABLE_MAILBOX_REFERRALS) == 0) {
+      prot_printf(proxyd_out, " MAILBOX-REFERRALS");
+    }
+		
     if (config_getint(IMAPOPT_IMAPIDLEPOLL) > 0) {
 	prot_printf(proxyd_out, " IDLE");
     }
diff -r -u cyrus-imapd-2.2.10.dist/imap/version.h cyrus-imapd-2.2.10/imap/version.h
--- cyrus-imapd-2.2.10.dist/imap/version.h	2004-11-23 09:52:52.000000000 -0800
+++ cyrus-imapd-2.2.10/imap/version.h	2005-01-14 12:46:38.391024296 -0800
@@ -55,7 +55,7 @@
 
 /* CAPABILITIES are now defined here, not including sasl ones */
 #define CAPABILITY_STRING "IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ " \
-	"MAILBOX-REFERRALS NAMESPACE UIDPLUS ID " \
+	"NAMESPACE UIDPLUS ID " \
 	"NO_ATOMIC_RENAME UNSELECT " \
 	"CHILDREN MULTIAPPEND BINARY " \
 	"SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES " \
diff -r -u cyrus-imapd-2.2.10.dist/lib/imapoptions cyrus-imapd-2.2.10/lib/imapoptions
--- cyrus-imapd-2.2.10.dist/lib/imapoptions	2004-07-21 12:07:45.000000000 -0700
+++ cyrus-imapd-2.2.10/lib/imapoptions	2005-01-14 12:47:41.125560426 -0800
@@ -630,6 +630,10 @@
    connections that these referrals would cause, thus resulting in a higher
    authentication load on the respective backend server. */
 
+{ "proxyd_disable_mailbox_referrals", 0, SWITCH }
+/* Set to true to disable the use of mailbox-referrals on the
+   proxy servers.*/
+
 { "proxyservers", NULL, STRING }
 /* A list of users and groups that are allowed to proxy for other
    users, seperated by spaces.  Any user listed in this will be


More information about the Pkg-Cyrus-imapd-Debian-devel mailing list