Skip to content

Instantly share code, notes, and snippets.

@VerosK
Last active August 29, 2015 14:20
Show Gist options
  • Save VerosK/bf51f96c26acb1ac0962 to your computer and use it in GitHub Desktop.
Save VerosK/bf51f96c26acb1ac0962 to your computer and use it in GitHub Desktop.
Connect to zimbra with SOAP
#!/usr/bin/env python
from pythonzimbra.tools import auth
from pythonzimbra.communication import Communication
SOAP_URL = 'https://zimbra.random.eu/service/soap/'
SOAP_ADMIN_URL = 'https://zimbra.random.eu:7071/service/admin/soap/'
USER = 'admin'
PASSWORD = 'password'
comm = Communication(SOAP_URL)
token =auth.authenticate(
SOAP_URL, USER, PASSWORD,
use_password=True, raise_on_error=True
)
print token
admin_comm = Communication(SOAP_ADMIN_URL)
admin_token =auth.authenticate(
SOAP_URL, USER, PASSWORD,
admin_auth=True,
use_password=True, raise_on_error=True,
)
print admin_token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment