The public core of Sendtrap: a Laravel package providing an embedded SMTP ingestion server, MIME processing, and the Workspace → Project → Inbox → Message domain that Sendtrap distributions are built on.
- SMTP ingestion server (
php artisan mail:smtp-server) — a ReactPHP socket server that accepts SMTP conversations (including STARTTLS), enforces per-workspace limits through host-bindable contracts, and hands accepted messages to the ingestion pipeline. - MIME processing — full multipart parsing, attachment extraction/checksums, envelope/BCC capture, merge-tag detection.
- Domain —
Workspace→Project→Inbox→Message/AttachmentEloquent models, factories, and an append-only migration set. - Token API — a bearer-token REST API per inbox (list/filter messages,
detail JSON, raw/HTML views, attachments, filtered bulk delete), with rate
limiting hooks.
/expectis the testing endpoint: one deterministic request that waits for mail, evaluates match conditions, applies assertions and answers with machine-readable diagnostics; named extractors — on/expectorPOST /messages/{id}/extract— pull verification codes, links, addresses and attachment metadata out of a message server-side, with explicit found/ambiguous states instead of guesses. The full surface is documented by an OpenAPI 3.1 contract shipped in this package atopenapi/sendtrap.yaml(JSON twin and a Postman collection alongside; regenerate withopenapi/generate.sh). Hosts serve it interactively — e.g. Sendtrap Community at/docs/api/reference. - Message checks — deliverability lint checks and an HTML client compatibility check scored against the caniemail dataset (see NOTICE for attribution).
- Shares & delivery — public share links, webhooks, auto-forwarding.
- First-run seeding (
php artisan sendtrap:send-test) — one command drops a rich example message (HTML + text, attachment, inlinecid:image, envelope-only BCC, merge tags) into an inbox with no configured application;--via-smtpdelivers it over a real loopback SMTP conversation (STARTTLS + AUTH) instead of injecting into the pipeline. - Host contracts —
WorkspaceContext,WorkspaceAccess,Entitlements,UsageMeter,LegacyOwnershipFallback: every product-policy decision (access, limits, quotas) is delegated to the consuming host application through these seams. The package ships no billing or account concepts.
composer require sendtrap/corePHP 8.3+ is required. The service provider
(Sendtrap\Core\SendtrapCoreServiceProvider) is auto-discovered; package
migrations load automatically and are append-only after the first release.
The package boots with no host wiring at all, but a host must supply the
following for the code paths it uses (the authoritative, commented list lives
on SendtrapCoreServiceProvider):
- The
inbox-api/inbox-api-waitrate limiter names — registered in the host's own service providerboot()withRateLimiter::for(); the package's routes reference exactly these two names. - A route named
dashboard— the bundled message-reader UI component links back to it. - Filesystem disks —
config('filesystems.default')must be a defined disk; the storage migration command additionally expects disks literally namedlocalands3to both exist during a migration run. config('services.spamcheck.*')— optional; spam scoring is a disabled-by-default no-op until a host publishesservices.spamcheck.enabled/url/timeout/threshold.
Sendtrap\Core\Testing\Concerns\InteractsWithSmtpServer is a supported,
host-facing test helper (deliberately under the production src/ autoload so
consuming applications can use it): it boots the real SMTP server on an
ephemeral port inside the test process and scripts SMTP conversations against
it. It imports only production dependencies.
The HTML compatibility check scores markup against the
caniemail support dataset
(CC-BY-4.0 — see NOTICE). Hosts vendor the dataset at
resources/data/caniemail/features.json and refresh it with
php artisan htmlcheck:sync-data.
main carries a branch alias for the current release minor (see
extra.branch-alias in this repository's composer.json), so a consuming
application can require unreleased core while still satisfying its caret
constraint — with the alias at 0.5.x-dev, for example:
{ "require": { "sendtrap/core": "dev-main as 0.5.x-dev" } }Semantic versioning on a 0.x line: breaking changes may land in minor
releases until 1.0, always with CHANGELOG/UPGRADE notes. Only the latest
0.x minor is supported. See SUPPORT.md and
CHANGELOG.md.
Please do not open public issues for vulnerabilities — see SECURITY.md for the private disclosure process.
MIT. The "Sendtrap" name and logo are not covered by the code license — see TRADEMARK.md.