Tadashi Ichihara wrote:
>
> Hi.
>
> I'm using vpopmail-4.0.10 with hard quota function.
> But ".current_size" file is not be updated correctly by vdelivermail.
>
> vdelivermail udpates ".current_size" file correctly after receiving new
> mesg. But when I delete all messages with POP3 client, and then
> receiving new mesg, ".current_size" file is be updated as new mesg size
> plus old worth.
>
> I changed 'vdelivermail.c' like followings:
>
> -------------------------------------------------------------
> @@ -786,6 +786,7 @@
>
> }
> } else {
> + cur_msg_bytes = recalc_quota(".");
> update_quota(cur_msg_bytes + msg_size);
> }
>
> -------------------------------------------------------------
>
> It looks good. ".current_size" file is be updated correctly.
> Is it correct solution ? I wondering...
The idea is that the .current_size file keeps counting up untill
the user reaches thier quota. At that point it calls the recalc_quota
to see if the .current_size file is accurate.
This minimizes the number of times vpopmail counts all the emails.
Perhaps a better name could be used for the .current_size file.
Like, .current_size_of_email_that_has_been_delivered_not_counting_
emails_that_have_been_deleted ;]
--
Ken Jones
"Live Free, Live GPL"
http://www.inter7.com/