>With all due respect, I did some of my own testing of vpopmail last  year
>and found that then, the quota mechanism didn't work (I was able to send
>more than the quota's worth of messages using small messages (and a perl
>script to send it rapidly). 

With all due respect, this method sucks. You just overcome the "userless 
system" privelege of vpopmail. Secondly, linux filesystem quotas sucks (I 
know many may not agree with me) because:
1. You can only do UID/GID based quotas (You cannot do quotas on 
directories)
2. It is slowwwww, Imagine having to do quotacheck every 30 minutes (if you 
have a big box hosting some hundreds of domains). 

>I chose instead to use system quotas and
>multiple UID's (one per domain) which is a VERY effective limiter but it >has made a 
>couple new bugs appear. 

As you may already know, you are now unfortunately doing quotas per entire 
domain, and not per user, which is what vpopmail should be doing correctly.
You missed the point. 

>For example, when the system quota is reached and an admin attempts to add
>users to the system, it can nuke the vpasswd.cdb file due to the write
>error. :-(  I haven't worked around that one yet...
 

I have a better solution for you (that is if you don't want to use 
vpopmail's quota support): 

Say you wanted to limit each one domain to 200 megs quota:
1- make a data directory to serve our virtual domains quota files
mkdir /home/vpopmail/data
(don't forget to set appropriate uid and gid permissions)
2- create a 200 meg file as follows:
dd if=/dev/zero of=/home/vpopmail/data/domainfile bs=1MB count=200
3- make a filesystem inside the file
mke2fs -F /home/vpopmail/data/domainfile
4- Mount it under the appropriate domain directory (make sure it is empty)
mount -o loop ~vpopmail/data/domainfile ~vpopmail/domains/domain.com
(also set appropriate uid and gid permissions on domain.com directory) 

now proceed with ./vadddomain and so
Would also be nice to put the mount command into your startup script in case 
you reboot.
This should effectively limit the domain to 200 MB. No need to keep doing 
quotacheck which takes a while (Especially when you have lots of directorys 
and sub directories). This method assumes that your kernel was compiled with 
"loop" filesystem support (usually true for most distributions because it is 
often used to create ramdisks and such). 

Good Luck 

P.S. I still want to fix that bug in vdelivermail that doesn't check quotas 
right.

Reply via email to