Knowledge Base

Zimbra Module for Blesta — Full Configuration Guide

Zimbra Module for Blesta — Full Configuration Guide

Version: 1.3.5 · Blesta: 5.x · PHP: 8.2+ · Zimbra: 10.x


Table of Contents

  1. Overview
  2. Installation
  3. License Activation
  4. Server Configuration
  5. Package Types
  6. Multi-Server Groups
  7. Ordering & Provisioning
  8. Admin Service Management
  9. Client Self-Service
  10. Service Lifecycle
  11. Email Notification Tags
  12. Zimbra Server Prerequisites
  13. Recommended COS Setup
  14. Troubleshooting

Overview

The Zimbra module integrates Blesta with a Zimbra 10.x mail server via its Admin SOAP API. It supports two distinct subscription models:

Model Description
Domain Provision and manage an entire mail domain (example.com). The domain owner controls all mailboxes via admin or client tabs.
Mailbox Provision a single email account (user@example.com). The mailbox owner can change their password and manage aliases.

Both models can be sold independently or together: a client can hold a domain subscription and then order additional mailbox subscriptions on top of it.


Installation

  1. Upload the module — copy the zimbra/ folder into your Blesta installation at:

    <blesta_root>/components/modules/zimbra/
  2. Install in Blesta — navigate to: Settings → Company → Modules → Available Modules Find Zimbra and click Install.

  3. Add a server — the module will show a prompt to add your first server. See Server Configuration below.

Manual installation only. The module is not distributed via Blesta’s marketplace importer; upload the files directly.


License Activation

A valid license is required before any services can be provisioned. The module will still install and display tabs without a license, but creating new services will be blocked.

Activating a License

  1. Go to Settings → Company → Modules → Zimbra → Manage.
  2. You will see a License section with an input field.
  3. Enter your license key and click Activate.
  4. The module contacts https://accounts.fxrm.com/ to validate the key.
  5. On success the field is replaced by a green status indicator and a Remove button.

License Statuses

Status Meaning
valid License is active. Services can be provisioned.
invalid Key was entered but failed validation.
unlicensed No key has been set.
expired License period has lapsed.
suspended License has been administratively suspended.
canceled License has been canceled.

Removing a License

Click the Remove button on the module management page. This clears the stored key and data. The module remains installed and usable for managing existing services; only new provisioning is blocked.

The module re-validates the license with the license server approximately every 24 hours. If the server is temporarily unreachable, the cached status is used.


Server Configuration

Each Zimbra server is added as a Module Row. Go to:

Settings → Company → Modules → Zimbra → Add Server

Fields

Field Required Description
Server Label Yes A friendly name shown in the Blesta admin UI (e.g., Production Mail Server). Not sent to Zimbra.
Hostname Yes The fully qualified hostname or IP of the Zimbra server (e.g., mail.example.com). Must be a valid hostname or IP.
Admin Username Yes The Zimbra admin account used for API calls (e.g., admin@example.com). Stored encrypted.
Admin Password Yes Password for the admin account. Stored encrypted.
Use SSL Yes Enables HTTPS for Admin SOAP API calls. Strongly recommended. Uncheck only for HTTP-only setups.
Admin Port No The Admin SOAP port. Defaults to 7071. Some Zimbra installations use 9071. Must be 1–65535.
Domain Limit No Maximum number of domains this server will accept. Leave blank for unlimited.
Notes No Free-text internal notes. Not used operationally.

Connection Test

When you save a server, the module immediately tests the connection by authenticating with the Zimbra Admin SOAP API. If authentication fails, the server is not saved and an error is shown. Common causes:

  • Hostname unreachable or DNS not resolving
  • Wrong port (try 7071 and 9071)
  • SSL setting mismatch (Zimbra serves HTTPS on 7071 by default)
  • Admin credentials incorrect or account locked

Package Types

Every Zimbra package has a Package Type selector. This determines what the package provisions and which tabs are shown on the service.

Domain Packages

Use when: Selling email hosting for a complete domain — the client gets their own @theirdomain.com and manages all mailboxes within it.

Configuring a Domain Package

Go to Packages → Create Package, select the Zimbra module, and set:

Setting Description Notes
Package Type Domain Determines the provisioning workflow.
Domain Aggregate Quota (GB) Total storage pool for all mailboxes under this domain. Default: 10. Set to 0 for unlimited.
Maximum Accounts Maximum number of mailboxes the client can create. Leave blank for unlimited.
Default Class of Service The COS applied to new mailboxes created via Zimbra (not via Blesta). Populated from your Zimbra server’s COS list.

What Gets Provisioned

When a client orders a domain package:

  • A new Zimbra domain is created matching the name they supply at checkout.
  • The domain’s zimbraMailQuota is set from Aggregate Quota (converted to bytes).
  • The domain’s zimbraMaxAccountsLimit is set from Maximum Accounts.
  • The domain’s zimbraDefaultCOSId is set if Default COS is selected.

Service Fields at Order Time

Field Description
Domain The domain name to create, e.g. myclientdomain.com. Must be a valid domain format.

The domain is automatically lowercased before provisioning.


Mailbox Packages

Use when: Selling individual email accounts, either as standalone subscriptions or as add-ons under a domain service.

Configuring a Mailbox Package

Setting Description Notes
Package Type Mailbox
Mailbox Domain The Zimbra domain where accounts will be created. Required unless using a parent domain service. E.g. mail.yourcompany.com.
Class of Service The COS assigned to each provisioned mailbox. Populated from Zimbra server. Leave blank to use Zimbra’s default.
Mailbox Quota (MB) Storage limit for each mailbox. Default: 1024. Set to 0 for unlimited.

Domain Resolution Priority

When a mailbox service is provisioned, the target domain is determined in this order:

  1. Parent service — if this package is ordered under a domain service (Blesta’s parent service relationship), the domain is taken from that service.
  2. Package Mailbox Domain — if no parent service exists, the domain configured on the package is used.
  3. Error — if neither is available, provisioning is blocked with a clear error.

This means you can:

  • Set Mailbox Domain on the package and sell standalone mailbox subscriptions without any parent service.
  • Leave Mailbox Domain blank and rely on Blesta’s parent-child service relationship (the client must already have a domain service).

Service Fields at Order Time

Field Who Sees It Description
Email Local Part Admin + Client The part before the @ (e.g. john.smith). 1–64 characters, letters/numbers/./_/- only.
Password Admin only Initial mailbox password. If left blank, a random secure password is generated automatically.
Display Name Admin + Client The full name shown in email clients (e.g. John Smith). 1–256 characters.

Clients cannot set their own password at order time; only admins can. Clients change their password via the self-service tab after the service is active.


Multi-Server Groups

If you run multiple Zimbra servers, you can create a Module Group to spread load across them.

  1. Go to Settings → Company → Modules → Zimbra → Add Server Group.
  2. Add multiple servers to the group.
  3. Choose an assignment strategy:
Strategy Behaviour
First Assigns to the first server in the group that has not reached its domain limit.
Round Robin Distributes domains evenly across servers in order.
  1. When creating a package, select the server group instead of a specific server.

Ordering & Provisioning

Domain Service Provisioning

Client places order for domain package
  → Blesta calls addService()
    → License check (fails? error shown, service not created)
    → Client-supplied domain name validated
    → API: AuthRequest (get session token)
    → API: CreateDomainRequest
        name = "theirdomain.com"
        zimbraMailQuota = <aggregate_quota in bytes>
        zimbraMaxAccountsLimit = <max_accounts>
        zimbraDefaultCOSId = <default_cos>
    → On success: stores zimbra_domain, zimbra_domain_id
    → Updates server domain count cache

Mailbox Service Provisioning

Client places order for mailbox package
  → Blesta calls addService()
    → License check
    → Determine domain (parent service → package setting → error)
    → Validate email local part format (1–64 chars, alphanumeric + ._-)
    → Generate password if not provided
    → API: AuthRequest
    → API: CreateAccountRequest
        name = "localpart@domain.com"
        password = <password>
        displayName = <display_name>
        zimbraCOSId = <cos_id>          (if set on package)
        zimbraMailQuota = <quota_bytes> (if set on package)
    → On success: stores zimbra_domain, zimbra_email, zimbra_email_local,
                  zimbra_password (encrypted), zimbra_display_name, zimbra_account_id

Manual Provisioning (use_module = false)

If you need to create a service record in Blesta without actually provisioning it on Zimbra (e.g., importing an existing domain), uncheck Use Module during admin service creation. The service fields are stored but no API calls are made.


Admin Service Management

Admins can manage services from Clients → [client] → Services → [service] → Manage.

Statistics Tab

Available for both domain and mailbox services.

Domain Statistics

Field Source
Domain Name Stored service field
Status zimbraDomainStatus from Zimbra API
Aggregate Quota zimbraMailQuota attribute (displayed in GB)
Quota Used GetQuotaUsageRequest (sum of all mailbox usage)
Max Accounts zimbraMaxAccountsLimit attribute
Current Accounts Live count from GetDomainRequest COS breakdown

Mailbox Statistics

Field Source
Email Address Stored service field
Display Name displayName attribute
Class of Service zimbraCOSName attribute
Status zimbraAccountStatus attribute
Quota zimbraMailQuota attribute (displayed in MB)
Quota Used GetQuotaUsageRequest

Mailboxes Tab

Available for domain services only. Allows admins to manage all mailboxes within the domain.

Viewing Mailboxes

The tab displays a table of all accounts under the domain with columns:

  • Email Address — full address
  • Display Name
  • Quotaused / limit MB, or used MB / Unlimited
  • Status — Active, Closed, Locked, etc.
  • Options — action buttons

The heading shows current account count vs. the configured limit (e.g., Mailboxes (3 / 10)). If Aggregate Quota is set on the package, an info note shows the total domain quota.

Adding a Mailbox

Fill in the inline form at the bottom of the table:

Field Notes
Local Part The username before the @. Auto-lowercased. 1–64 chars.
@domain.com Displayed automatically — cannot be changed here.
Display Name Optional. Defaults to the local part if blank.
Password Required. Enter a secure password.
Quota (MB) Storage limit for this mailbox. 0 = unlimited.

Click + Add. If the domain is at its account limit, the form is hidden and a message is displayed instead.

Editing Quota

Click Quota next to any mailbox. A detail panel expands below the row showing the current quota value. Edit and click Save Quota.

Setting quota to 0 removes the quota limit (unlimited storage, subject to the domain’s aggregate quota).

Resetting a Password

Click Reset Password next to any mailbox. A detail panel expands with a password field. Enter the new password and click Save Password.

Managing Aliases

Click Aliases next to any mailbox. A detail panel expands showing:

  • A table of current aliases, each with a Remove button.
  • An Add Alias form: enter the local part (e.g., support), the @domain.com suffix is shown automatically.

Aliases are full email addresses that deliver to this mailbox. There is no limit other than what Zimbra enforces.

To add an alias: type the local part and click + Add. To remove an alias: click the red Remove button on the alias row.

The Aliases button shows a badge with the current alias count when aliases exist.

Deleting a Mailbox

Click Delete next to any mailbox. A confirmation prompt is shown. On confirm, the account is permanently deleted from Zimbra.

Deletion is immediate and permanent. There is no recycle bin.


Distribution Lists Tab

Available for domain services only. Distribution lists are group email addresses that forward to multiple recipients.

Viewing Lists

The tab shows all distribution lists under the domain with:

  • Email Address — the list address
  • Description
  • Member Count
  • Options — action buttons

Creating a Distribution List

Fill in the form at the bottom:

Field Notes
Local Part The listname before the @.
Display Name Optional friendly name.
Description Optional description.

Click Create List.

Managing Members

Click Members next to a list. A detail panel expands showing current members and an add form.

Adding members: Enter one or more email addresses in the text area (one per line or comma-separated). Click Add Members.

Removing a member: Click Remove next to any individual member.

Deleting a Distribution List

Click Delete next to the list. Confirmed via prompt. The list is permanently removed.


Client Self-Service

Clients access service management from their Client Portal → Services → [service] → Manage.

Domain Services (Client)

Clients with a domain subscription see the same tabs as admins (Statistics, Mailboxes, Distribution Lists) with the same functionality. This allows resellers to grant full domain management to their clients without Blesta admin access.

All forms use the same client-facing URIs and the same validation rules as the admin tabs.

Mailbox Services (Client)

Clients with a mailbox subscription see two tabs:

Statistics Tab

Displays their mailbox’s current statistics (read-only). See Mailbox Statistics above.

Actions Tab

Two sections:

Change Password

Field Notes
New Password Minimum 8 characters.
Confirm Password Must match New Password.

Click the button to save. A success message confirms the change.

Email Aliases

Displays a table of current aliases, each with a Remove button, followed by an Add Alias form.

Field Notes
Local Part The alias username before the @.
@domain.com Shown automatically from the account’s domain.

Click Add Alias to create. Click Remove next to any existing alias to delete it.


Service Lifecycle

Suspend

Triggered when a service is suspended in Blesta (e.g., non-payment).

Type Zimbra Action
Domain Sets zimbraDomainStatusclosed. All mailboxes in the domain are immediately inaccessible.
Mailbox Sets zimbraAccountStatusclosed. The single account is inaccessible.

Unsuspend

Triggered when a suspended service is reactivated.

Type Zimbra Action
Domain Sets zimbraDomainStatusactive.
Mailbox Sets zimbraAccountStatusactive.

Cancel / Terminate

Triggered when a service is cancelled or terminated.

Type Zimbra Action
Domain Permanently deletes the domain from Zimbra. All mailboxes, data, and emails under the domain are destroyed.
Mailbox Permanently deletes the account from Zimbra. All emails and data are destroyed.

Cancellation is irreversible at the Zimbra level. Blesta does not archive data before deletion.

Edit Service

Admins can edit service fields in Blesta. Editable fields and their effect:

Package Type Field Zimbra Action
Domain Domain name Not updated in Zimbra — domain rename is not supported. Stored value only.
Mailbox Display Name Updates displayName and cn on the Zimbra account.
Mailbox Password Updates the account password in Zimbra.
Mailbox Email Local Part Not updated in Zimbra — email rename is not supported.

Email Notification Tags

These variables are available in Blesta email templates for Zimbra services:

Module Tags

Tag Value
{m.host_name} Zimbra server hostname

Package Tags

Tag Value
{p.package_type} domain or mailbox
{p.aggregate_quota} Domain quota in GB (domain packages)
{p.max_accounts} Max mailbox limit (domain packages)
{p.cos_id} Class of Service ID (mailbox packages)
{p.mailbox_quota} Per-mailbox quota in MB (mailbox packages)

Service Tags

Tag Value
{s.zimbra_domain} The domain name (e.g. example.com)
{s.zimbra_email} Full email address (mailbox packages)
{s.zimbra_password} Mailbox password — use in welcome emails
{s.zimbra_display_name} Mailbox display name

Security note: Include {s.zimbra_password} only in the initial welcome email. Do not include it in renewal or other routine emails.


Zimbra Server Prerequisites

Admin SOAP API Access

The module communicates with Zimbra via the Admin SOAP API (port 7071 HTTPS). Ensure:

  1. Port 7071 (or your configured port) is reachable from the Blesta server.
  2. The admin account used has at minimum:
    • createDomain / deleteDomain
    • createAccount / deleteAccount / modifyAccount
    • setPassword
    • getQuotaUsage
    • createDistributionList / deleteDistributionList
    • addAccountAlias / removeAccountAlias

Self-Signed Certificates

The module does not enforce SSL certificate validation, so self-signed certificates on your Zimbra server are supported.

Zimbra Version

The module targets Zimbra 10.x. The SOAP API is stable across Zimbra versions, so earlier 8.x installations may work but are untested.


Classes of Service (COS) in Zimbra control what features a mailbox has access to. Configure COS in Zimbra Admin Console before setting up packages in Blesta.

Suggested Tier Structure

COS Name Features to Enable Blesta Package Idea
Basic IMAP, POP3, Webmail only Starter mailbox, small quota
Professional + Calendar, Contacts, Tasks, Shared Folders Business mailbox
Enterprise + Mobile Sync (ActiveSync), Delegation, Briefcase Premium mailbox

Once created in Zimbra, they appear in the COS dropdowns on both domain and mailbox package configuration pages.


Troubleshooting

Connection Test Fails at Server Add/Edit

Symptom Likely Cause Fix
“Connection failed” Port unreachable Check firewall; try port 9071 if 7071 fails.
“Authentication failed” Bad credentials Re-enter username/password; ensure account is not locked in Zimbra.
SSL errors Hostname mismatch The module bypasses SSL validation, so this should not occur. Check use_ssl setting.
Timeout Zimbra not running Check Zimbra services with zmcontrol status.

Domain Provisioning Fails

Error Cause Fix
Domain already exists Domain was previously created in Zimbra Delete from Zimbra first, or use manual provisioning to import.
api.result: ... Zimbra API error Check Zimbra logs at /opt/zimbra/log/zimbra.log.
license.required No valid license Activate a license on the module management page.

Mailbox Provisioning Fails

Error Cause Fix
Email address already exists Account exists in Zimbra Delete from Zimbra first, or use manual provisioning.
parent_service.required No domain to create mailbox on Set Mailbox Domain on the package, or link the service to a parent domain service.
zimbra_email_local.format Invalid characters in local part Only a–z 0–9 . _ - are allowed; no spaces or special characters.
COS not found COS ID set on package no longer exists in Zimbra Update package COS selection to match current Zimbra COS.

Quota Shows as 0

Quota usage is fetched live from Zimbra’s GetQuotaUsageRequest. If it shows 0:

  • The domain may have no mailboxes yet, or all are empty.
  • Zimbra’s quota index may need refreshing: run zmmailboxdctl start or wait for the nightly indexing job.

Aliases Not Showing

Ensure you are on module version 1.3.2 or later. Earlier versions did not explicitly request the zimbraMailAlias attribute from Zimbra’s SearchDirectoryRequest, which caused aliases to not be returned on some Zimbra configurations.

Mailboxes Tab Shows Stale Data

The tab fetches live data from Zimbra on every page load. If data appears stale, it is likely a browser caching issue — hard refresh the page.

“No valid license” on Provisioning

The license is re-validated every 24 hours. If validation recently failed (e.g., temporary network issue reaching the license server), the cached status may be stale. Go to Settings → Modules → Zimbra → Manage and check the license status. The module will attempt re-validation automatically on the next cycle.


For support, contact FXRM Services.

Please rate this article to help us improve our Knowledge Base.

0 0