> According to the docs, it should be:
> int vadddomain( char *domain)
> domain = the new virtual domain
>
> but it is
>
> int vadddomain( char *domain, char *dir, int uid, int gid);
>
> so what are the dir, uid and gid params for (I suppose the first is
> the dir (like test.com for test.com) to be used for the domain and id
> stuff is the UNIX user/group that is the owner of the domain
> directory)?
>
> So assuming this is true, would it make sense to simply write a
> wrapper function
> Vadddomain(char * domain)
> {
> struct passwd *pwdata;
> pwdata=getpwnam(VPOPMAIL_USER);
> //use domain as dir cause anything different is pretty confusing
> vadddomain(domain, domain, pwdata->pw_uid, pwdata->pw_gid);
> }
the "dir" is the base directory not the full path.
you would want:
vadddomain(domain, pwdata->pw_dir, pwdata->pw_uid, pwdata->pw_gid);
you could avoid the call to getpwnam by using the constants defined in
vpopmail_config.h:
vadddomain(domain, VPOPMAILDIR, VPOPMAILUID, VPOPMAILGID);
HTH,
--
-------------------------
Sean P. Scanlon
http://bluedot.net/
perl -e 'print pack("h*", "3707370426c6575646f647e2e65647"), "\n"'
-------------------------