I went through all these same problems a week or so
ago. Here's the trick.
Courier doesn't have Admin users. You log in as the valid
user you're trying to check. So if you want to check
the user's quota you would pass their username and password
instead of "mailadmin" and "password". The QUOTAROOT in
courier is ALWAYS either ROOT or SHARED, for most people it's
always ROOT. So instead of "user.kalowsky" pur "ROOT". Then,
assume you're maildirquota stuff is working, you'll get
the right reply. Be sure to test outsite of PHP that you
can issue the right IMAP commands. Try this
$ telnet imapserver 143
Trying 10.10.220.1...
Trying 209.87.64.101...
Connected to dnslab.dsl.net.
Escape character is '^]'.
* OK Courier-IMAP ready. Copyright 1998-2001 Double Precision, Inc. See COPYING for
distribution information.
. login username password
. OK LOGIN Ok.
. CAPABILITY
* CAPABILITY IMAP4rev1 QUOTA CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT
THREAD=REFERENCES SORT
. OK CAPABILITY completed
. GETQUOTA ROOT
* QUOTA "ROOT" (STORAGE 17 10240)
. OK GETQUOTA Ok.
. logout
* BYE Courier-IMAP server shutting down
. OK LOGOUT completed
Connection closed by foreign host.
$
Let me know if you need more help.
On Wed, Dec 19, 2001 at 07:40:50PM +0100, Uros Gruber wrote:
> I thought so. But one think i don't know. I have some script for
> getting qouta info for some users. But it's working on cyrus.
>
> I wan't to know what is the command to get this data, because cyrus
> have some administrator user to check this. How can i login to
> courier, to get this info.
>
>
> Here is a PHP script to do this.
>
> $mbox = imap_open("{your.imap.host}","mailadmin","password",OP_HALFOPEN)
> or die("can't connect: ".imap_last_error());
>
> $quota_value = imap_get_quota($mbox, "user.kalowsky");
> if(is_array($quota_value)) {
> print "Usage level is: " . $quota_value['usage'];
> print "Limit level is: " . $quota_value['limit'];
> }
>
> imap_close($mbox);
>
> You can see that there is some mailadmin. How can i use this with
> courier.
--
Joshua Warchol
UNIX Systems Administrator
DSL.net
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users