--- lib/imapoptions 27 Aug 2008 08:28:47 -0000 1.55 +++ lib/imapoptions 18 Sep 2008 23:57:28 -0000 @@ -788,7 +805,10 @@ { "proxyd_disable_mailbox_referrals", 0, SWITCH } /* Set to true to disable the use of mailbox-referrals on the - proxy servers. */ + proxy servers. This includes referrals that might have been + issued in response to normal commands like APPEND, SELECT, etc, + and also privileged commands like SETQUOTA, CREATE (a top-level + mailbox), etc. See also proxyd_allow_status_referral. */ { "proxyservers", NULL, STRING } /* A list of users and groups that are allowed to proxy for other --- imap/imapd.c 27 Aug 2008 08:28:46 -0000 1.550 +++ imap/imapd.c 18 Sep 2008 23:57:33 -0000 @@ -6416,8 +6416,29 @@ imapd_authstate, quota_cb, server_rock); if (!r) { - /* Do the referral */ - imapd_refer(tag, server_rock, name); + if (supports_referrals) { + /* Do the referral */ + imapd_refer(tag, server_rock, name); + } else { + struct backend *s; + + s = proxy_findserver(server_rock, &imap_protocol, + proxy_userid, &backend_cached, + &backend_current, &backend_inbox, + imapd_in); + if (!s) r = IMAP_SERVER_UNAVAILABLE; + + imapd_check(s, 0, 0); + + if (!r) { + prot_printf(s->out, "%s Getquota {%d+}\r\n%s\r\n", + tag, strlen(name), name); + pipe_including_tag(s, tag, 0); + } else { + prot_printf(imapd_out, "%s NO %s\r\n", tag, + error_message(r)); + } + } free(server_rock); } else { if(server_rock) free(server_rock); @@ -6477,10 +6498,7 @@ if (!r && (mbtype & MBTYPE_REMOTE)) { /* remote mailbox */ - if (imapd_userisadmin) { - /* If they are an admin, they won't retain that privledge if we - * proxy for them, so we need to refer them -- even if they haven't - * told us they're able to handle it. */ + if (imapd_userisadmin && supports_referrals) { imapd_refer(tag, server, name); } else { struct backend *s; @@ -6635,8 +6653,30 @@ imapd_check(NULL, 0, 0); if (!r) { - /* Do the referral */ - imapd_refer(tag, server_rock, quotaroot); + if (supports_referrals) { + /* Do the referral */ + imapd_refer(tag, server_rock, quotaroot); + } else { + struct backend *s; + + s = proxy_findserver(server_rock, &imap_protocol, + proxy_userid, &backend_cached, + &backend_current, &backend_inbox, + imapd_in); + if (!s) r = IMAP_SERVER_UNAVAILABLE; + + imapd_check(s, 0, 0); + + if (!r) { + prot_printf(s->out, "%s Setquota {%d+}\r\n%s" + " (STORAGE %d)\r\n", tag, + strlen(quotaroot), quotaroot, newquota); + pipe_including_tag(s, tag, 0); + } else { + prot_printf(imapd_out, "%s NO %s\r\n", tag, + error_message(r)); + } + } free(server_rock); } else { if (server_rock) free(server_rock);