Download the PHP package siberfx/mail-sdk-kerioconnect without Composer
On this page you can find all versions of the php package siberfx/mail-sdk-kerioconnect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download siberfx/mail-sdk-kerioconnect
More information about siberfx/mail-sdk-kerioconnect
Files in siberfx/mail-sdk-kerioconnect
Package mail-sdk-kerioconnect
Short Description Kerio Connect SDK for Laravel: SMTP-AUTH mail sending and mailbox provisioning through the Kerio Connect JSON-RPC admin API.
License MIT
Homepage https://github.com/siberfx/mail-sdk-kerioconnect
Informations about the package mail-sdk-kerioconnect
Kerio Connect SDK for Laravel
A native Kerio Connect SDK for Laravel applications. It does two things:
- Mail sending — SMTP-AUTH straight to your Kerio Connect server on its own Symfony Mailer
instance, separate from
config/mail.phpand theMailfacade. Your existing mailers and Mailables stay untouched; sending through Kerio is an explicit call. - Mailbox provisioning — create, look up, enable/disable mailboxes and manage aliases on a
Kerio domain through the JSON-RPC admin API. Built for SaaS onboarding (every tenant gets its
own mailbox) without hand-rolled
curlcalls against:4040/admin/api/jsonrpc/.
The scope is deliberately the user level inside an already existing domain. Creating the domain itself (DNS records, the Kerio domain object) is an infrastructure step and stays out of the application.
Requirements
- PHP 8.3, 8.4 or 8.5
- The
ftpPHP extension (ext-ftp) - Laravel 12 or 13
- A Kerio Connect server with the administration API reachable (port 4040 by default)
On most distributions ext-ftp ships with PHP itself; if it is missing, install it with
sudo apt install php8.4-ftp (Debian/Ubuntu), sudo dnf install php-ftp (RHEL/Fedora), or by
enabling extension=ftp in php.ini (Windows). Verify with php -m | grep ftp.
Installation
That is all. The service provider is registered through Laravel's package auto-discovery, so
there is nothing to add to bootstrap/providers.php or config/app.php, and the KerioConnect
facade alias is registered for you.
Publish the config file only if you want to change the defaults:
Configuration
Everything is driven by environment variables; the merged package config works without publishing.
From address: the SMTP mailbox must own the From address — as its login address or as an extra email address (alias). Otherwise Kerio rejects the message with
553 5.1.8(sender does not match the authenticated user). SeeaddEmailAddress()below.
Run php artisan about to see the resolved Kerio Connect settings at a glance.
Usage
Dependency injection (recommended)
Every component is bound against a contract, so type-hint what you need and Laravel injects it — in controllers, jobs, commands, listeners, anywhere the container resolves:
Available contracts, all in Siberfx\MailSdkKerioConnect\Contracts:
| Contract | Implementation | Purpose |
|---|---|---|
MailTransport |
MailSender |
Sending mail over Kerio's SMTP submission |
MailboxProvisioner |
MailboxManager |
Mailbox and alias management |
RpcClient |
JsonRpcClient |
Raw admin JSON-RPC calls |
Facade
For quick call sites, the KerioConnect facade exposes the same three components:
Components are resolved from the container on first use, so an application that only sends mail never opens an admin API session.
Sending mail
For attachments, text parts or custom headers, compose a Symfony Email yourself:
Delivery failures throw Siberfx\MailSdkKerioConnect\Exceptions\KerioConnectException.
Mailbox provisioning
create() is deliberately not an upsert: it throws when the login already exists, so
provisioning code can never silently reset a live mailbox's password. Check exists() first.
Aliases
Two Kerio quirks the SDK handles for you: emailAddresses is a plain array of local parts (not
objects), and Users.set replaces the field wholesale — so the current list is read back and the
alias appended. The call is idempotent.
Raw JSON-RPC
For admin API methods that have no wrapper yet:
Session handling
Every call() reuses a cached session — the X-Token header and the cookie together, because
Kerio treats them as one pair — stored for KERIOCONNECT_TOKEN_TTL seconds (default 600) in the
configured cache store. On a session error the client logs in again exactly once and replays
the call, never more, so a bad credential can never turn into a login loop against the mail server.
Use a shared cache store (redis, file, database) in production so queue workers reuse one
session instead of each opening their own. Domain ids are cached for 5 minutes as well.
Error handling
| Exception | When |
|---|---|
KerioConnectAuthException |
Login failed, or a session was rejected |
KerioConnectException |
Everything else: RPC errors, HTTP errors, delivery failures |
KerioConnectAuthException extends KerioConnectException, so catching the latter catches both.
Testing
Unit tests mock the HTTP layer (Guzzle's MockHandler) and the feature tests boot a real Laravel
container through Testbench — the suite never talks to a mail server.
Code style is enforced with Laravel Pint:
Security
If you discover a security issue, please email [email protected] instead of opening a public issue.
License
The MIT License (MIT). See LICENSE.
All versions of mail-sdk-kerioconnect with dependencies
ext-ftp Version *
guzzlehttp/guzzle Version ^7.5
illuminate/contracts Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
symfony/mailer Version ^7.0|^8.0
symfony/mime Version ^7.0|^8.0