Bug #14673 Updated: quota ressources
| From: | sniper@php.net | Date: | Sat, 06 Jul 2002 22:55:40 +0000 |
| Subject: | Bug #14673 Updated: quota ressources | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13334@lists.php.net to get a copy of this message | ||
ID: 14673
Updated by: sniper@php.net
Reported By: kaalh@smol.org
-Status: Open
+Status: Assigned
Bug Type: IMAP related
Operating System: Debian Woody i386
PHP Version: 4.1.0
-Assigned To:
+Assigned To: kalowsky
New Comment:
Assigning to Dan, as he was working on with some other
quota stuf.
Previous Comments:
------------------------------------------------------------------------
[2002-07-06 16:34:35] llima@imagelink.com.br
The patch does work. Actually, it works exactly as advertised. Now
imap_get_quota() gets only the value returned by the STORAGE resource
and ignores the rest.
------------------------------------------------------------------------
[2002-07-06 15:09:51] php@tcs.eng.br
My bad. The problem is really on php_imap.c, as noted by
kaalh@smol.org.
I have produced a patch to "fix" the behavior reported by
llima@imagelink.com.br. I can't produce a patch to report all the
resources as kaalh@smol.org suggested because that would break the
compatibility :-/.
Anyway, here's the (small) patch:
--- php_imap.c Wed Apr 24 12:30:16 2002
+++ php_imap_fixed.c Sat Jul 6 15:47:55 2002
@@ -374,8 +374,12 @@
/* this should only be run through once */
for (; qlist; qlist = qlist->next)
{
- IMAPG(quota_usage) = qlist->usage;
- IMAPG(quota_limit) = qlist->limit;
+ if (!strcmp(qlist->name, "STORAGE"))
+ {
+ IMAPG(quota_usage) = qlist->usage;
+ IMAPG(quota_limit) = qlist->limit;
+ break;
+ }
}
}
/* }}} */
Suggestions or comments, please mail me. I haven't tested the patch
yet, BTW!! But my good friend is testing it for me and I'll ask him to
post the results here. :)
------------------------------------------------------------------------
[2002-07-06 11:27:53] php@tcs.eng.br
It appears to me that the error is on the IMAP library:
php_imap.c:1031:if(!imap_getquota(imap_le_struct->imap_stream,
Z_STRVAL_PP(qroot))) {
imap_getquota() is implemented by the IMAP library. I'll try and see
if I can find the error on the library and then post a patch.
------------------------------------------------------------------------
[2002-06-11 05:54:09] tmlfung@yahoo.com.hk
My imap server(InterMail server) returns:
0 getquota ""
* QUOTA "" (STORAGE 250 10000 MESSAGE 26 1500)
0 OK GETQUOTA completed
imap_get_quota is unable to return the STORAGE value.
------------------------------------------------------------------------
[2002-05-28 16:48:51] llima@imagelink.com.br
I have the same problem. I'm not an experienced programmer so I could
not come with a patch. However, I've experienced it first hand.
The IMAP server we use replies with (STORAGE aa bb TRIGGER cc dd),
where TRIGGER is a value em bytes that triggers the server to send a
warning to the user.
PHP4 is considering the usage to be cc and the quota dd, just like
described by kaalh@smol.org. Looks like it really gets the last two
numbers it finds and uses them.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/14673
--
Edit this bug report at http://bugs.php.net/?id=14673&edit=1