[vchkpw] User quota logic question

2009-02-19 Thread George Negoita
Hello!

I have the following problem: when a message is delivered by
vdelivermail, maildirsize is updated twice:
235 1
305 1

Apparently, first time it is updated before adding the Return-Path:
and Delivered-To: headers. Digging into this issue, I think I found
the problem.

Before the actual delivery, when the quota is checked by calling
user_over_maildirquota() in maildirquota.c, maildirsize is updated
the first time:

//   stat file  is regular filesize  0
   what is q?
if (fstat(0, stat_buf) == 0  S_ISREG(stat_buf.st_mode) 
stat_buf.st_size  0  *q)
{   //   check the quota, and not again error
if (maildir_checkquota(dir, quotafd, q, stat_buf.st_size, 1)
 errno != EAGAIN)
{
if (quotafd = 0)   close(quotafd);
ret_value = 1;
} else {
maildir_addquota(dir, quotafd, q, stat_buf.st_size,
1); // -
if (quotafd = 0)   close(quotafd);
ret_value = 0;
}
} else {
ret_value = 0;
}

What is the logic of calling maildir_addquota() in the code above?
If I comment the marked line, apparently all works fine. Is there a
reason why maildir_addquota should be called there?

I'll update to 5.4.27 and do the change above on a little production
server and I'll return with details in a couple of days.

-- 
George Negoita
System Administrator
iMedia Plus Group

!DSPAM:499d398832681284318247!



Re: [vchkpw] User quota logic question

2009-02-19 Thread Matt Brookings
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

George Negoita wrote:
 Hello!
 
 I have the following problem: when a message is delivered by
 vdelivermail, maildirsize is updated twice:
 235 1
 305 1

George, there are indeed some issues with the quota system in vpopmail.
I'm currently working to fix these issues and hope to have something to
add to the trunk revision soon.
- --
/*
Matt Brookings m...@inter7.com   GnuPG Key D9414F70
Software developer Systems technician
Inter7 Internet Technologies, Inc. (815)776-9465
*/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmdeNwACgkQ6QgvSNlBT3DaTgCfRW49+f/lzMKTU4C7dGB7qXdn
t68AoKVXf247x4Xzs03Ho1pdX6Cnw+j6
=6elr
-END PGP SIGNATURE-