Zimbra API Integration
This skill should be used when the user asks about "SOAP API", "REST API", "Zimbra LDAP", "authentication token", "preauth", "ZCS API", "AdminService", "MailService", "zmsoap", or mentions programmatic access to Zimbra. Covers SOAP, REST, and LDAP interfaces for Zimbra integration.
What this skill does
# Zimbra API Integration
Guide for integrating with Zimbra using SOAP API, REST API, and LDAP queries.
## API Overview
Zimbra provides multiple integration interfaces:
| Interface | Use Case | Port |
|-----------|----------|------|
| SOAP API | Full functionality, admin operations | 7071 (admin), 443 (user) |
| REST API | Calendar, contacts, documents | 443 |
| GraphQL | Modern web client (9.x+) | 443 |
| LDAP | Directory queries, provisioning | 389 |
## SOAP API
### Authentication
#### User Authentication
```xml
<!-- AuthRequest -->
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<AuthRequest xmlns="urn:zimbraAccount">
<account by="name">[email protected]</account>
<password>userpassword</password>
</AuthRequest>
</soap:Body>
</soap:Envelope>
```
Response provides `authToken` for subsequent requests.
#### Admin Authentication
```xml
<!-- Admin AuthRequest (port 7071) -->
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<AuthRequest xmlns="urn:zimbraAdmin">
<account by="name">[email protected]</account>
<password>adminpassword</password>
</AuthRequest>
</soap:Body>
</soap:Envelope>
```
#### Preauth (SSO)
Generate preauth token for seamless login:
```python
import hashlib
import hmac
import time
def generate_preauth(account, preauth_key, timestamp=None, expires=0):
"""Generate Zimbra preauth token"""
if timestamp is None:
timestamp = int(time.time() * 1000)
# Format: account|by|expires|timestamp
data = f"{account}|name|{expires}|{timestamp}"
signature = hmac.new(
preauth_key.encode(),
data.encode(),
hashlib.sha1
).hexdigest()
return {
'account': account,
'timestamp': timestamp,
'expires': expires,
'preauth': signature
}
```
```xml
<!-- PreauthRequest -->
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<AuthRequest xmlns="urn:zimbraAccount">
<account by="name">[email protected]</account>
<preauth timestamp="1234567890000" expires="0">computed-signature</preauth>
</AuthRequest>
</soap:Body>
</soap:Envelope>
```
### Common SOAP Requests
#### Get Account Info
```xml
<GetAccountInfoRequest xmlns="urn:zimbraAccount">
<account by="name">[email protected]</account>
</GetAccountInfoRequest>
```
#### Search Messages
```xml
<SearchRequest xmlns="urn:zimbraMail" types="message" limit="100">
<query>in:inbox is:unread</query>
</SearchRequest>
```
#### Send Message
```xml
<SendMsgRequest xmlns="urn:zimbraMail">
<m>
<e t="t" a="[email protected]"/>
<su>Subject</su>
<mp ct="text/plain">
<content>Message body</content>
</mp>
</m>
</SendMsgRequest>
```
#### Create Appointment
```xml
<CreateAppointmentRequest xmlns="urn:zimbraMail">
<m>
<inv>
<comp name="Meeting">
<s d="20240115T100000" tz="America/New_York"/>
<e d="20240115T110000" tz="America/New_York"/>
</comp>
</inv>
<su>Team Meeting</su>
</m>
</CreateAppointmentRequest>
```
### Using zmsoap
Command-line SOAP client:
```bash
# User request
zmsoap -z -m [email protected] GetInfoRequest
# Admin request
zmsoap -z -a [email protected] GetAllAccountsRequest
# With specific namespace
zmsoap -z -t account GetAccountInfoRequest @by=name @[email protected]
# Search
zmsoap -z -m [email protected] SearchRequest @types=message query "in:inbox"
```
## REST API
### URL Patterns
```
# Calendar (iCal)
https://mail.domain.com/home/[email protected]/calendar?fmt=ics
# Contacts (vCard)
https://mail.domain.com/home/[email protected]/contacts?fmt=vcf
# Briefcase files
https://mail.domain.com/home/[email protected]/Briefcase/file.pdf
# Search results
https://mail.domain.com/home/[email protected]/?fmt=json&query=in:inbox
```
### Authentication Methods
```bash
# Basic auth
curl -u [email protected]:password \
"https://mail.domain.com/home/[email protected]/calendar?fmt=ics"
# Auth token cookie
curl -b "ZM_AUTH_TOKEN=authtoken" \
"https://mail.domain.com/home/[email protected]/calendar"
# Preauth URL
curl "https://mail.domain.com/service/[email protected]×tamp=...&preauth=..."
```
### Common REST Operations
```bash
# Export calendar
curl -u user:pass "https://mail/home/user/calendar?fmt=ics" > calendar.ics
# Import contacts
curl -u user:pass -X POST \
-H "Content-Type: text/vcard" \
--data-binary @contacts.vcf \
"https://mail/home/user/contacts"
# Upload to Briefcase
curl -u user:pass -X PUT \
--data-binary @document.pdf \
"https://mail/home/user/Briefcase/document.pdf"
# Get folder structure
curl -u user:pass "https://mail/home/user/?fmt=json&view=folder"
```
## LDAP Integration
### Connection Parameters
```bash
# Get LDAP password
zmlocalconfig -s -m nokey zimbra_ldap_password
# LDAP URL
ldap://localhost:389
# Base DN
zimbra
```
### Common Queries
```bash
# Search all accounts
ldapsearch -x -H ldap://localhost:389 \
-D "uid=zimbra,cn=admins,cn=zimbra" \
-w "$(zmlocalconfig -s -m nokey zimbra_ldap_password)" \
-b "ou=people,dc=domain,dc=com" \
"(objectClass=zimbraAccount)"
# Find user by email
ldapsearch -x -H ldap://localhost:389 \
-D "uid=zimbra,cn=admins,cn=zimbra" \
-w "$(zmlocalconfig -s -m nokey zimbra_ldap_password)" \
-b "" \
"([email protected])"
# Get domain info
ldapsearch -x -H ldap://localhost:389 \
-D "uid=zimbra,cn=admins,cn=zimbra" \
-w "$(zmlocalconfig -s -m nokey zimbra_ldap_password)" \
-b "dc=domain,dc=com" \
"(objectClass=zimbraDomain)"
```
### Python LDAP Example
```python
import ldap
# Connect
conn = ldap.initialize('ldap://zimbra-server:389')
conn.simple_bind_s('uid=zimbra,cn=admins,cn=zimbra', ldap_password)
# Search accounts
results = conn.search_s(
'ou=people,dc=domain,dc=com',
ldap.SCOPE_SUBTREE,
'(objectClass=zimbraAccount)',
['mail', 'displayName', 'zimbraAccountStatus']
)
for dn, attrs in results:
print(f"{attrs.get('mail', [b''])[0].decode()}: {attrs.get('displayName', [b''])[0].decode()}")
```
## GraphQL API (9.x+)
Modern Web Client uses GraphQL:
```graphql
# Endpoint: /graphql
# Get folders
query {
getFolder {
folders {
id
name
unread
}
}
}
# Search messages
query {
search(query: "in:inbox", types: MESSAGE, limit: 50) {
messages {
id
subject
from {
address
}
}
}
}
```
## Error Handling
### Common Error Codes
| Code | Meaning |
|------|---------|
| `account.AUTH_FAILED` | Invalid credentials |
| `account.NO_SUCH_ACCOUNT` | Account not found |
| `service.PERM_DENIED` | Insufficient permissions |
| `mail.NO_SUCH_FOLDER` | Folder not found |
| `mail.QUOTA_EXCEEDED` | Mailbox full |
### Retry Logic
```python
import time
def make_soap_request(url, body, max_retries=3):
for attempt in range(max_retries):
try:
response = requests.post(url, data=body, timeout=30)
response.raise_for_status()
return response
except requests.exceptions.Timeout:
if attempt < max_retries - 1:
time.sleep(2 ** attempt)
else:
raise
```
## Additional Resources
### Reference Files
- **`references/soap-api-reference.md`** - Complete SOAP namespace documentation
- **`references/ldap-schema.md`** - Zimbra LDAP schema details
### Example Files
- **`examples/soap-client.py`** - Python SOAP client wrapper
- **`examples/preauth-generator.py`** - Generate preauth tokens
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.