Marcin Gondek wrote:
Is there any way to add domain not by vadddomain but via PHP direct inserting data (domain info) in mysql table?
Without any disk access, only php+mysql
Maybe is there somekind od vpopmail API for php?
Only in the bleeding edge CVS versions of vpopmail and qmailadmin. It is still very much under construction, and not ready for use on a live server. If you have room on a development machine help coding or testing is welcome.
I have some PHP code that might help you access the vpopmail api from php here:
The first release of pmailadmin hasn't happened yet, the files are only in CVS. The daemon and daemon interface work, there are a few functions in the utilities but many more that need to be written. The extension works but I haven't written the object to abstract it yet.
If you need to create domains today, make vadddomain SUID root, and exec() it. That is how I manage domains using the extension. Even running Apache as vpopmail:vchkpw doesn't allow you to add or remove domains because you have to edit files in /var/qmail and restart the qmail daemon. That takes root.
Of course, you also have to make vadddomian executable by apache. The problem is, now anyone who can write PHP scripts on the machine can create mail domains. There is more information in the README and INSTALL files of the PHP vpopmail extension on the pmailadmin site.