Probably not recommended as this will shoot the I/O requirements as the maildirsize file will be overwritten everytime a new email comes in. If you would like to do this due to some reason do the following:
In the patched qmail source with the qmail-ldap patch, around line 182 in maildir++.c uncomment the loop and the line containing quota_parsesize function call like this
// if (*fd != -1) {
// ret = quota_parsesize(q, fd, buf5120, i);
// } else {
ret = quota_calcsize(q, fd, buf5120, i);
// }
And rebuild qmail-local with “make qmail-local” and “cp qmail-local /var/qmail/bin/qmail-local”.