Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
6 posts • Page 1 of 1
I am trying to migrate accounts from one mail system to another using the Zimbra soap API. It is very quick to generate new accounts this way. However it is slow to generate the contacts that go along with these accounts. Right now I have to do an authRequest as the admin and then do a delegate auth request for the account I want to create the contact for and then do a createcontactrequest to make a new contact. So for each contact I have I have to do three requests. Not very fast when the average account I am trying to migrate has over 40 contacts and I am trying to migrate close to 5700 accounts for one of my domains. I would like to just authenticate as an admin and then do a delegateAuthentication as the user I want to make the contacts for and then just spin off all the contacts for that user. The only way I can see to do this is to use the pre auth key somehow but, I am not sure how. If anyone knows how to tackle this problem it will be much appreciated. Thank you
Nevermind I figured it out.
Could you please explain how you figured this out or share your implementation. I'm sure you are/were in the same position I am in with useless zimbra docs.
I would be interested to see how you solved this too
Ended up figuring it out, here is the solution. But you need to generate a preauth token on your zimbra server
Code: Select all
$account = new AccountSelector(AccountBy::NAME(), 'firstname.lastname@example.org');
$preAuth = new PreAuth(time() * 1000, null, 0);
$preAuth->computeValue($account, INSERT_GENERATE_PREAUTH_TOKEN_HERE );
$api = MailFactory::instance('https://domain.com/service/soap');
$result = $api->auth($account, null, $preAuth);
Who is online
Users browsing this forum: No registered users and 3 guests