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 file                size > 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!

Reply via email to