Thanks.. sure, i can upload the code little more later. I not really a programmer, so my code its so basic.
My works is around this:
I have a webserver with apache+ssl+php and a php system did it by the programer senior. This program create and delete accounts from email server using cyrus system and sasldb berkeley DB. It also update a ldap server and a main alias map. So, im going to migrate that system with around 14000 mailboxes to zimbra. The office want keep the php manager program but they want update it removing the cyrus mailboxes module and create the new system for zimbra. So. I compiled php with SSH support to connect from the webserver to zimbra system using public/private keys and executing remote commands sending args to my bash script on my zimbra server. So.
If the new program call ssh "user@zimbra ./bashcript create
user@domain.com password" my script will create the account, on zimbra and set the proppers options for all created users. Again, if the php system want erase any user, check their quota, account status and enable or disable it, all is did it by my bash script and not directly using the zmprov commands.