Looking to hire Laravel developers? Try LaraJobs

laravel-wingclip maintained by niels-anders

Author
Last update
2026/11/25 12:20 (v0.7.2)
License
Downloads
0

Comments
comments powered by Disqus

The Wingclip mailbox with a captured mail open

Wingclip is a mail transport plus a small inbox UI. Point your staging, test or demo environment at the wingclip mailer and nothing reaches real recipients anymore: every message is stored and shown at /wingclip, behind its own login. No SMTP server to run, no external service, no subscription. Hand your client a login and they can check the mails themselves.

  • wingclip mail transport, set MAIL_MAILER=wingclip and you're done
  • Stored in your own database (wingclip_* tables), attachments on any filesystem disk
  • Separate login, independent from your app's users, with admins and viewers and per-user access ("may see mail to *@client.com")
  • Inbox with folders, search and a detail view: HTML preview (desktop and phone width), plain text, headers, raw source (.eml download) and attachments
  • Retention period and limits in config/wingclip.php, pruned daily by the scheduler
  • Off in production by default

Supports Laravel 10, 11, 12 and 13 on PHP 8.1+.

Local and online

Most mail catchers (Mailpit, MailHog, the one in Herd or Laragon) only work on your own machine: they run a separate SMTP server next to your app, and the inbox lives on localhost. That's fine while you develop, but it stops at your laptop.

Wingclip lives inside the app itself, so it works the same everywhere the app runs:

Your machine Staging, test or demo server
Catches all outgoing mail ✓ ✓
Inbox at /wingclip ✓ ✓
Extra server or service needed no no
Share with a client or tester – hand them a login

Deploy to a test server, set MAIL_MAILER=wingclip, and your client can read the order confirmations, password resets and invoices the app sent, in their own browser, without any of it reaching a real inbox. Mail is stored in the app's own database, so it survives deploys and restarts like the rest of your data.

Installation

composer require niels-anders/laravel-wingclip
php artisan migrate
php artisan wingclip:user you@example.com --admin

Then set the mailer in .env:

MAIL_MAILER=wingclip

Open /wingclip and sign in.

The wingclip mailer is registered automatically. To use it explicitly, for example in a failover or roundrobin mailer, add it to config/mail.php:

'mailers' => [
    'wingclip' => ['transport' => 'wingclip'],
],

Production

The inbox is disabled when APP_ENV=production, so installing the package can never expose an inbox on a live site by accident. To use Wingclip on a production-like environment (a demo or acceptance server running with APP_ENV=production), enable it explicitly:

WINGCLIP_ENABLED=true

The transport itself always works: if the app sends through the wingclip mailer, mail is captured and never delivered.

Users and access

There are two roles:

Viewer Admin
Read, search, mark read/unread, download .eml and attachments ✓ ✓
Delete messages, empty the mailbox ✓
Invite, edit and delete users (the Users screen) ✓

Every user also has May see mail to: * for all mail, or one or more addresses separated by commas, with * as a wildcard, for example *@client.com, info@example.com. It matches To, Cc and Bcc. Mail outside it is hidden from the list and returns a 404.

Admins invite users from Users in the sidebar. Wingclip never emails the invitation: you get a one-time link (valid for 7 days) to share yourself, so no mail credentials are needed on a test environment. The invited user picks a name and password and is signed in.

An admin can't delete or demote themselves, and the last admin can't be removed, so nobody gets locked out. From the command line:

php artisan wingclip:user you@example.com --admin
php artisan wingclip:user client@example.com --scope="*@client.com"
php artisan wingclip:user someone@example.com --delete

Configuration

php artisan vendor:publish --tag=wingclip-config
Key Default Description
enabled null Inbox routes on or off. null means on everywhere except production.
label host of APP_URL Shown under the logo and on the sign-in page.
path / domain wingclip / null Where the inbox is served.
middleware ['web'] Middleware for all Wingclip routes.
database.connection null Database connection for the wingclip_* tables.
attachments.disk / .path local / wingclip Where attachment files are stored.
retention.days 7 Messages older than this are pruned. null keeps them forever.
retention.schedule true Schedule wingclip:prune daily.
limits.max_messages 1000 The oldest messages are removed above this amount.
limits.max_message_size 10240 (KB) Larger messages are kept without their source and attachment contents.
limits.max_attachment_size 5120 (KB) Larger attachments are listed, but their contents are not stored.
invitations.expire_days 7 How long an invitation link works.

Every value has a WINGCLIP_* environment variable, see the config file.

Commands

php artisan wingclip:user name@example.com [--name=] [--password=] [--admin] [--scope=] [--delete]
php artisan wingclip:prune [--all]

wingclip:user creates a login or updates an existing one. Without --password you are asked for one; when running non-interactively a password is generated and printed.

Daily pruning needs the Laravel scheduler to run (schedule:run in cron).

Customising

php artisan vendor:publish --tag=wingclip-config
php artisan vendor:publish --tag=wingclip-migrations
php artisan vendor:publish --tag=wingclip-views

Security

  • The inbox is only reachable with a Wingclip login. Sign-in attempts are rate limited.
  • HTML mail is rendered in a sandboxed iframe without scripts.
  • Wingclip accounts live in their own table and guard; they never grant access to your app.

Found a security issue? Please mail niels.anders@gmail.com instead of opening a public issue.

Development

composer install
composer test

Tests run on in-memory SQLite (pdo_sqlite required). A local demo with sample mail:

vendor/bin/testbench package:create-sqlite-db
vendor/bin/testbench migrate:fresh
vendor/bin/testbench db:seed --class="Wingclip\Tests\Fixtures\DemoSeeder"
vendor/bin/testbench serve

Sign in with demo@example.test / wingclip-demo.

License

MIT, see LICENSE.