You can do with with Perl's "system" or "exec" calls, and I'm sure that
PHP has equivalent calls as well.   Just call the binary from your script.
 Why not use the product as its architected?  Sheez!

> Hello Paul, hello all,
> Paul: The reason why I do NOT want vadduser or any commandline tool is
> that I want to write a perl script which automatize user generation.
> Cool would would be If one could run:
> vadduser $variable_password
> or something like this in
> Perl or PHP code!
>  Regs,
> Oliver Etzel
>> Oliver Etzel - GoodnGo.COM \(R\) writes:
>> > I want to create new users like [EMAIL PROTECTED] NOT with vadduser
>> >  BUT with just inserting it via mysql-insert into the vpopmail
>> > database.
>> OK, you have now explained what you want to use instead.  Somebody
> else
>> pointed out that the maildir will be created automatically by
> vdelivermail
>> if the user exists (I hadn't realized it did that until I read that
>> message and looked at the code just now) so you can get away with
> doing
>> that.  What you have yet to explain is any valid or sensible reason
>> you want to do this.
>> > Any hints,
>> > how I can generate the encrypted password in the column pw_passwd
>> > (looks like this $1$S/TPu$GjMMj7yMJqG.0ckx) ???????
>> Not without breaking out of MySQL and returning to the shell.  The
>> hard way is to get a shell prompt, use passwd to set the password of
> a
>> dummy system user then copy the crypted password into the MySQL
> command.
>> The harder way is to write a perl script that generates some good
> random
>> salt, calls crypt to crypt the password then uses the DBD modules to
>> insert the user into MySQL.  An easy way to do it is to add the
>> user with MySQL giving garbage for the crypted password then use
> vmoduser
>> to set a valid crypted password.  The very easy way to do it is to
> run
>> vadduser.
>> You CANNOT do it all from MySQL.  You CAN do it all with vadduser.
> What
>> is more, I can see no reason why you would want to add a user but
>> have the maildir created at the same time, which is all you could
> achieve
>> if you could do it all from MySQL  If you have some automation tool
>> that can only cope with adding MySQL rows then you'll still have to
>> modify it to shell out to generate the crypted password, so you
> might
>> as well modify it to shell out and run vadduser anyway.  If you want
>> domain admins to be able to add users this way because they cannot
> run
>> vadduser you'll still have to write code that validates they can
> only
>> modify their own domains, so you'd be far better off installing
> something
>> like qmailadmin on your server.
>> --
>> Paul Allen
>> Softflare Support

Reply via email to