procmail
[Top] [All Lists]

Re: Implementing Mail Quotas without Kernel Support

1999-09-20 21:31:15
Tee Emm <tm(_at_)super(_dot_)net(_dot_)pk> writes:
I am interested in limiting the mailbox sizes of my users without using
kernel quotas. This is so because the only file that my users own on my
systems is their mailboxes (residing in /var/spool/mail). Since my
sendmail invokes procmail to deliver the emails to my users, I was
wondering if procmail could automatically determined before writing to a
mailbox if it is over a certain size limit? Has someone been to this
area before? 

There's no code in procmail right now to do so.  Determining a user's
quota and usage or even how much disk space is free is very system
specific.  For example, samba 2.0 has *six*, count'em six, different
versions of the routine that determines a user's quota, and it's still
considered 'experimental'.  This is a not direction that procmail wants
to go.  Right now it determines when the user has hit their quota in the
only portable way: writing to the file and checking for errno==EDQUOT.


IMHO, if procmail could provide such a facility, sendmail/qmail servers
can be build up that can support tens of thousands of users WITHOUT
slowing down the system (because of the quota checks that the system
performs at each and every disk write operation).

The only time procmail uses more than one call to write() to deliver a
message is when delivering to an mbox-style folder and the message either
contains "From " lines that need to be escaped or it doesn't have a
trailing newline.  Directory folders never require more than one write().


Finally, if quota checks slow down your system that much, you should
either be yelling at the vendor (if it's a commercial OS) or fixing it
yourself (if it's a Open Source OS).


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>