Automatically add IMAP accounts via SOAP or anything

Hey,

Is there a way to use the soap interface or command line to add/configure IMAP accounts? I need to be able to fully manage accounts from an external system through an automated sync. If there is a command line way, I could wrap a shell service around it or something. Any ideas are appreciated.

If I understand your question correctly, you want to create an account and then associate an external IMAP account with it?

If that's right, you'll want to use something like CreateAccountRequest and follow that with a CreateDataSourceRequest. Here's references to the SOAP API (you could use command line utilities too if you don't want to get into doing SOAP yourself):

To get familiar with their usage, you may want to use the '-d -vv' arguments to zmprov / zmmailbox or perhaps using firebug / developer tools while using the Admin interface to emulate how requests are made in ZCS.

I used the soap api mentioned to create the external account. It creates but the password of the registered data source is saved as empty. I have specified along with the other info, but only the password is missing when the datasource is created.

Using that soap call I was able to create the external account ( data source). I used the fields available when doing a zmprov gds. All fields worked, except password, that goes blank. After adding the DataSource using Soap then manually updating using Preferences->Accounts, it works.

Am I missing something here? e.g. password must be sent using any special treatment? Thanks in advance.

Hey, I don't think it is a folder id issue, I tried using 2 ( INBOX) for id, also. Same issue: the account gets created with blank password. Creating the account using command line cmd cds with the exactly the same parameters works ( both id 2 and NULL).

Since you've determined that you can get things working OK with zmprov, you might try comparing the request made via zmprov (use zmprov -d -vv cds ...) and your soap request to see if you can determine any potential differences or sources of problems. There may also be useful info logged in /opt/zimbra/log/mailbox.log. If you still can't find the problem, we'll probably need to see the complete soap request here.

hmm, I was sure that at some point adding data sources from zmprov worked, but I am experiencing the same issue ( no password) with it, too. I tried zimbraDataSourceFolderId 2, NULL, and creating a folder then using its ID. Same result. I was using 8.0.4 and upgraded to 8.0.5 to see if was fixed. No luck. I uninstalled and installed version 7.2.5, just to make sure. Still no luck.