> >   > Or are they implemented with system quotas?
  > >
  > > You can do that also if you wish, however you'll need to
  > > supply your own scripts for that.
  > So, basically, no? What would I have to supply to use system
  > quotas?

If you wish to use system quota's, you'll need to write a script
to update the system quota.  I'm on solaris, so I use a script
that sends some commands to "edquota".  On linux, it may be different.

  > >   > Will I still be able to use maildrop to filter my mail?
  > >
  > > I'm unsure about maildrop.  If it delivers the mail via
  > > vdelivermail, then yes, but if it writes directly to the
  > > file system, it needs to be patched to enforce the quotas.
  > > I've updated libvpopmail.a to include the quota code, so
  > > you should be able to patch it if needed.
  > Maildrop is maildir++ compatible. I assume that this new code
  > deviates from the maildir++ standard?

Yes, however only for "user" quotas.  There's no concept of "domain"
quotas in courier that I'm aware of.  This code is maildir++ compliant,
but now vdelivermail uses the "limits" API to retrieve the per-domain
limits (disk quota & max msg count) and enforce it by making a check
at the current usage (which calculates usage by summing up the usage
for each mailbox within a domain).

  > >   > When are the quotas recalculated? (If maildrop deletes a message,
  > >   > will it throw the quotas off?)
  > >
  > > The domain quota code recalculates the quota each time on the fly.
  > > One big benefit now is its use of the maildirsize files, if they're
  > > there.  This is a big performance gain.  But if you don't have anything
  > > creating & maintaining these files (and they don't exist), then the
  > > performance would be pretty bad if people "leave mail on server", and
  > > you constantly have to sum up thousands of files.  I haven't used 
  > > and I see the maildirsize files in each user's Maildir so I assume
  > > vdelivermail is maintaining them.  You'll need to try it out and see
  > > what kind of performance you get.  In my copy, I have syslog()'s
  > > logging the clock over these and I typically see about 0.001s
  > > when the cache files are there, and up to 7s when they're not (but
  > > then they suddenly appear, so it must be creating them by default).
  > > The 7 seconds was due to a user with a few thousand messages still in 
  > > and no maildirsize file.
  > OK. So, when vdelivermail delivers a message to the maildir, it just
  > modify's the quota based on the email's size, correct? It doesn't
  > actually recalculate the entire quota?

I believe it checks if the file is there and recalulates the entire
maildir if its missiing.  If its there, it just appends the quota information
to the maildirsize file.

  > What happens when an IMAP or POP server deletes a message from the
  > maildir? Is the quota then incorrect? I use Courier-IMAP.
I use courier-imap as well as the courier pop3 daemon.

I believe the imap server recalculates the quota for the maildir.
I'm not sure whether it recalculates the whole user maildir, or
just removes one entry from the file.  You'll have to check the code.

  > Is there a way to recalculate a user's maildir quota via command line?
  > (For instance, so that all of my user's quotas could be recalculated at
  > 4 AM from scratch via a shell script or Perl script?)

Not that I'm aware of.  I think you automatically get it if its not there
during a delivery.  Since maildrop is part of courier (I assume it is),
then it probably manages the maildirsize files already as vdelivermail does.
It probably enforces "user" quotas, but I'm not sure.  It won't enforce
domain quotas without patching it to retrieve & enforce a domain level
quota.  You'll need the vget_limits() function from the vpopmail library
for that.

  > Thanks for all the info!

No prob.  Good luck.


Reply via email to