On Thu, Feb 09, 2006 at 04:55:44PM +0100, Rudy Gevaert wrote:
> when updating the quota in the ldap database the imap server only shows 
> this updated quota number after the delivery of a new email.  (I guess 
> this is normal.)
> 
> However setting the quotastring to 'X' doesnt work.  The previously 
> installed quota remains active on the imap server.
> 
> Is this normal?

"Use The Source, Luke" [TM]

courier-imap/maildir/maildirquota.c
-----------------------------------

        if (newquota)
        {
                parsequotastr(newquota, &info->quota);

                if (info->quota.nbytes == 0 &&
                    info->quota.nmessages == 0)
                {
                        close(info->fd);
                        info->fd= -1;
                        errno=EINVAL;
                        return (-1);
                }

... and later ...

        if ( maildir_openquotafile(info, maildir))
                info->fd= -1;

        if (newquota != NULL)
        {
                parsequotastr(newquota, &mq);

                if ((mq.nbytes > 0 || mq.nmessages > 0) &&
                    (info->fd < 0 || info->quota.nbytes != mq.nbytes ||
                     info->quota.nmessages != mq.nmessages))
                {
                        if (info->fd < 0)
                        {
                                maildir_quota_set(maildir, newquota);
                                if (maildir_openquotafile(info, maildir))
                                        info->fd= -1;
                        }
                        else
                        {
                                info->quota=mq;
                                info->recalculation_needed=1;
                        }
                }
        }
        if (info->fd < 0)
                return (0);     /* No quota set on this maildir */

Now, parsequotastr() returns nbytes=0 and nmessages=0 if it is unable to
parse the quota string, and should also log a warning along the lines of

   quota string 'X' not parseable

But the above code shows that a new quota will not be installed unless
nbytes>0 or nmessages>0

So as far as I can see, it's not possible to remove a quota simply by
changing the LDAP attribute. You need to remove the LDAP attribute, *and*
delete the maildirsize file.

Alternatively, set a huge quota, such as "1000000C" (which means one million
messages, and no limit on the total number of bytes). However courier-imap,
plus whatever you're using to deliver into the maildir, will still go
through the overhead of calculating the quota for each message.

HTH,

Brian.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Courier-imap mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to