On Mon, Apr 22, 2002 at 05:32:08AM +0800, Rock Stone wrote:
> hi all,
> 
> Is anyone found the quota handling warning and bounce
> not work correctly?
> 
> Please look this:
> after use patch 20011001a,
> file qmail-local.c
> 
> line 268:
> ---
>    if ( quota_check(&q, mailsize, 1, &perc) ) /* 0 if OK */
>      if ( quota_recalc(fn, &msfd, &q, mailsize, 1, &perc) )
>        quota_bounce("mailfolder");
>    if ( perc > QUOTA_WARNING_LEVEL )
>        /* drop a warning when mailbox is around 80% full */
>      quota_warning(fn);
> 
> ---
> 
> I change it to:
> ---
>    if ( quota_check(&q, mailsize, 1, &perc) == -1 )
>        quota_bounce("mailfolder");
>    if ( perc > QUOTA_WARNING_LEVEL )
>        /* drop a warning when mailbox is around 70% full */
>      quota_warning(fn);
> 
> ---
> 
> Another:
> file qmail-local.c,line 214
> --
>  if (!stralloc_cats(&foo, "/usr/sbin/qmail-quotawarn")) temp_nomem();
> --
> 
> The qmail's log tell me that file /var/qmail/usr/sbin/qmail-quotawarn
> NOT found,so I change it to:
> 
> --
>  if (!stralloc_cats(&foo, "/bin/qmail-quotawarn")) temp_nomem();
> --
> 
> 
> Now everything works OK!
> 
> Who can explain this?
> 
The First of your patches is bad because it violates the maildir++ quota
algorithm.
If the user is overquota the quota has to be recalculated (because the
maildirsize file could be wrong). It could be that a non maildir++ client
has deleted all files without updating maildir++'s maildirsize file.

If we are overquota quota_check and quota_recalc return -1 (which
evaluates to true) and therefor calls quota_bounce.
In your case the quota would not be recalculated (updated with current
values).

The second patch is very strange. Neither my qmail-local.c does not have a
reference to /usr/sbin/qmail-quotawarn nor the patch from
http://www.nrg4u.com.

-- 
:wq Claudio

Reply via email to