[imp] Patch for Cyrus quota (reworked)
Richard.Heggs at nottinghamcity.gov.uk
Richard.Heggs at nottinghamcity.gov.uk
Mon Dec 29 03:07:41 PST 2003
Hi List,
This is a reworked version of the patch I submitted before Christmas.
The difference between this patch and my previous attempt is that this
patch
takes into account the namespace parameter, for those people who have
nonstandard Cyrus installations.
This is a small patch against HEAD that fixes the call to
imap_get_quota().
I have studied http://www.php.net/manual/en/function.imap-get-quotaroot.php
and http://www.php.net/manual/en/function.imap-get-quota.php and the two
functions seem to work quite differently. I also had a read through of
http://asg.web.cmu.edu/cyrus/download/imapd/altnamespace.html. I had a
great Christmas, you can tell :)
imap_get_quotaroot() is a non-admin function and works with the internal
namespace (INBOX is the root, all other folders are underneath INBOX).
imap_get_quota() requires a cyrus administrator account, and works with the
physical namespace (defaults to user.).
This patch works for me (Cyrus 2.1.15, default namespace). I have never set
up a CYrus installation with an alternate namespace, and I don't know of
anyone who has, so I cant ask... but I think this patch should work for
them too. I can't see any obvious reason why it wouldn't.
Richard
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
######################################################################
This e-mail (and any attachments) is confidential and may contain personal
views which are not the views of Nottingham City Council unless specifically
stated. If you have received it in error, please delete it from your system,
do not use, copy or disclose the information in any way nor act in reliance
on it and notify the sender immediately. Please note that Nottingham City
Council monitors e-mails sent or received. Further communication will
signify your consent to this.
######################################################################
-------------- next part --------------
Index: cyrus.php
===================================================================
RCS file: /var/rsync-horde/imp/lib/Quota/cyrus.php,v
retrieving revision 1.17
diff -u -r1.17 cyrus.php
--- cyrus.php 30 Sep 2003 18:33:34 -0000 1.17
+++ cyrus.php 29 Dec 2003 10:27:10 -0000
@@ -59,7 +59,7 @@
} else {
$stream = @imap_open(IMP::serverString(), $this->_params['login'], $this->_params['password'], OP_HALFOPEN);
if ($stream !== false) {
- $quota = @imap_get_quota($stream, 'INBOX');
+ $quota = @imap_get_quota($stream, $_SESSION['imp']['namespace'].$_SESSION['imp']['user']);
@imap_close($stream);
}
}
More information about the imp
mailing list