Download the PHP package beziworld/laravel-mailcow without Composer
On this page you can find all versions of the php package beziworld/laravel-mailcow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beziworld/laravel-mailcow
More information about beziworld/laravel-mailcow
Files in beziworld/laravel-mailcow
Package laravel-mailcow
Short Description Laravel client for the mailcow API: domains, mailboxes, aliases, quotas, DKIM, app passwords, mail queue and logs.
License MIT
Homepage https://github.com/beziworld/laravel-mailcow
Informations about the package laravel-mailcow
Laravel mailcow
Laravel client for the mailcow: dockerized API: domains and alias domains, mailboxes, aliases and catch-all addresses, quotas, DKIM keys, app passwords, rate limits, the Postfix queue, the quarantine, container logs and status, for one or many mail servers.
Polska wersja dokumentacji
Features
X-API-Keyauthentication, read-only and read-write keys, several servers as named connections- Typed results (
Domain,Mailbox,Alias,DkimKey,AppPassword,LogEntry,QueueItem) with the full object inrawand dates in the time zone of your server - Reliable error detection: mailcow answers failed changes with HTTP 200 and
"type": "danger"; every failed item becomes anApiExceptionwith the translation key (domain_exists,mailbox_quota_exceeded, ...) - The
{}answer mailcow sends for empty lists and missing objects becomes[]ornull - Quotas in MB on input, bytes on output, plus
quotas()->nearlyFull(90)for alerts - Mail queue actions as implemented by mailcow (
flush,deliver,hold,release,delete,clear) - GET requests are repeated once after a connection error or HTTP 5xx; changes are sent exactly once
get()andpost()for any endpoint,php artisan mailcow:checkto test a connection- PHP 8.3+, Laravel 12 and 13, PHPStan level 8
Why this package
There is no Laravel package for mailcow on Packagist (checked in November 2026). The framework-agnostic clients
(exbil/mailcow-php-api, e-monsite/mailcow-php-client, vexura/mailcow-api) return the raw answers and leave
the HTTP 200 failures of mailcow to you. This package is built from the official OpenAPI spec of
mailcow-dockerized and its json_api.php, follows the source code where the spec examples are inconsistent (mail
queue actions), adds Laravel configuration, typed data, Http::fake() support for your own tests and an Artisan
check.
Installation
Create the key in the mailcow UI (Configuration > Access > Edit administrator details > API), choose read-only or read-write access and allow only the IP address of your application.
Usage examples
Provision mail for a new customer
Domains and alias domains
Mailboxes
Quotas
Aliases and catch-all
App passwords
Queue, quarantine, logs and status
Several servers
Anything else
Exceptions
All exceptions extend MailcowException:
| Exception | When |
|---|---|
AuthenticationException |
HTTP 401 (unknown key or address not allowed) or 403 (read-only key used for a change, isReadOnlyKey()). Never retried. Extends ApiException. |
ApiException |
An item failed (type danger or error, also with HTTP 200), HTTP errors and connection errors: path(), errorKey(), messages(), httpStatus(), payload() |
RateLimitException |
HTTP 429, retryAfter() in seconds |
InvalidConfiguration |
Unknown connection, missing URL / key or an invalid time zone |
Notes
- Multi-item calls (
delete('a@x', 'b@x')) are processed item by item by mailcow; when one item fails the exception lists all failures andpayload()holds the answers of the successful ones. - The alias domain endpoints are implemented by mailcow but missing from the published OpenAPI spec.
- The OpenAPI examples of
edit/mailqanddelete/mailqsend{"action": ...}; mailcow readsitemsandattr.actioninstead, which is what this package sends.
Development
Author
Created and maintained by Kamil Ćwiertnia, beziworld.eu.
- E-mail: [email protected]
- Issues and feature requests: GitHub issues
- Security vulnerabilities: see SECURITY.md
Need an integration? Get in touch through beziworld.eu.
Other packages by the author
- beziworld/laravel-ispconfig: ISPConfig 3 remote API
- beziworld/laravel-hestiacp: Hestia Control Panel
- beziworld/laravel-directadmin: DirectAdmin
License
MIT. See LICENSE.md. This package is not affiliated with the mailcow project or its maintainers.
All versions of laravel-mailcow with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.8
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0