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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mail-sdk-kerioconnect

Kerio Connect SDK for Laravel

Latest Version on Packagist Tests Total Downloads

A native Kerio Connect SDK for Laravel applications. It does two things:

  1. Mail sending — SMTP-AUTH straight to your Kerio Connect server on its own Symfony Mailer instance, separate from config/mail.php and the Mail facade. Your existing mailers and Mailables stay untouched; sending through Kerio is an explicit call.
  2. 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 curl calls 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

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). See addEmailAddress() 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

PHP Build Version
Package Version
Requires php Version ^8.3|^8.4|^8.5
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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package siberfx/mail-sdk-kerioconnect contains the following files

Loading the files please wait ...