Michael Boman wrote:
>
> Sumith Ail wrote:
> >
> > Hi
> >
> > There is one feature which is very much required in
> > vpopmail "quota support for virtual domains" or
> > vpopmail support of multiple uid and gid so that Unix
> > quota system can be implemented...the latter is
> > better.
> >
> > may I know when this feature will be available?
> >
> > has somebody configured a workaround in vpopmail to
> > support quota restriction for an entire virtual domain
> > not user.
> >
> > I am in URGENT requirement of this feature...please
> > help me.
> >
> > Thanks in advance
> > Sumith
>
> Well, basicly it isn't hard to do it when you start think about it.
>
> The solution you can use right now (at this very moment) is create
> another user in the system, and install vpopmail as that user (ie:
> re-installing vpopmail, but as an different user). This will make
> vpopmail use yet another UID/GID and you can happely set a system quota
> on that user. Ofcourse the drawback with that is you use more diskspace
> for the binary (small price IMHO) and you have a setup that is a little
> harder to maintain.
>
> The future solution is that some of the programs (like
> vadddomain/vdeldomain etc) run as root (SUID root to be sure, even if I
> am against SUID programs). That way the vadddomain program could allow
> yet another parameter: username or UID of the domain. In this case you
> could have up to 64k domains with induvidual domain quota that is
> controlled by your OS - and therefor _should_ be less heavy on the
> vdeliver program.
>
> Ken, please let me know if this is something you will add to the code so
> I can make my GlobalAdmin make use of it as well.
About 50% of the code is in the vpopmail library to use the uid/gid
stored in the /var/qmail/users/assign file. Another 50% still uses
the compiled in vpopmail uid/gid from the config.h.
I've gone through the exercise, twice, of converting to fully using the
uid/gid from /var/qmail/users/assign. It requires changes to
the API, which makes me stop and wonder if there is a better
method. Each time i backed off and started.
Take a look at the
char *vget_assign( char *domain, char *dir, int dir_len, int *uid, int
*gid )
function.
It takes an input domain and returns dir, uid and gid.
So the basic lookup code is there.
Also the vadddomain code would need to be modified to take a user
or user and group on the command line.
Ken