[imp] Quota question (fro cyrus imap)

Julien Marchal Julien.Marchal@univ-nancy2.fr
Fri, 25 Jan 2002 08:08:56 +0100


For cyrus imap server, you must give the imap admin user name and his password.
Personnaly,I don't want to put this information in my IMP configuration.

In cyrus imap, a simple user can get his quota. But he must use the get_quota_root instruction and not the simple get_quota.
To do this I modify php source (I going to write to the php list)
In php 4.1.1 and c-client imap-2001a :

in file php-4.1.1/ext/imap/php_imap.h Line 180 : 
 >/* Add to have quota_root support */
 >PHP_FUNCTION(imap_get_quota_root);

in file php-4.1.1/ext/imap/php_imap.c Line 134 : 
 >/* Add to have quota_root support */
 >PHP_FE(imap_get_quota_root,                                            NULL)

in file php-4.1.1/ext/imap/php_imap.c Line 1047 : 
 >/* {{{ proto array imap_get_quota_root(int stream_id, string qroot)
 >       Returns the quota set to the mailbox account qroot */
 >PHP_FUNCTION(imap_get_quota_root)
 >{
 >       zval **streamind, **qroot;
 >       pils *imap_le_struct;
 >
 >       if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &qroot) == FAILURE) {
 >               ZEND_WRONG_PARAM_COUNT();
 >       }
 >
 >       ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
 >
 >       convert_to_string_ex(qroot);
 >
 >       /* set the callback for the GET_QUOTA function */
 >       mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota);
 >       if(!imap_getquotaroot(imap_le_struct->imap_stream, Z_STRVAL_PP(qroot))) {
 >               php_error(E_WARNING, "c-client imap_getquotaroot failed");
 >               RETURN_FALSE;
 >       }
 >
 >       if (array_init(return_value) == FAILURE) {
 >               php_error(E_WARNING, "Unable to allocate array memory");
 >               RETURN_FALSE;
 >       }
 >               
 >       add_assoc_long(return_value, "usage", IMAPG(quota_usage));
 >       add_assoc_long(return_value, "limit", IMAPG(quota_limit));
 >}
 >/* }}} */

And in my IMP conf.php in function imp_show_quota I use imap_get_quota_root : 
// recuperation du quota
 > $quota =3D@imap_get_quota_root($stream, 'user.' . $imp['user']);

I don't know if it's the best solution, but for cyrus it work fine.
I going to do a patch for this.


At 12:48 24/01/2002 -0600, vous avez écrit:


>Hi.. I use horde 2.0 and imp 3.0
>I try to use the quota option, but I have a question...
>the file says.. imap admin user and password, What admin user and passwd I=
 need
>to put?
>I use IMAP 2001a.
>
>Thanks.
>
>Fabian Carballo
>
>------------------------------------------------------
>This mail sent through IMP: http://webmail.intercr.com
>
>-- 
>IMP mailing list: http://horde.org/imp/
>Archive: http://marc.theaimsgroup.com/?l=imp&r=1&w=2
>Frequently Asked Questions: http://horde.org/faq/
>To unsubscribe, mail: imp-unsubscribe@lists.horde.org

-- Julien Marchal --

Email : Julien.Marchal@univ-nancy2.fr

Université NANCY 2 - C.R.I. 
13, Rue Michel Ney 
CO 75 - 54037 Nancy Cédex