Laravel service that ingests inbound emails, stores MIME, and triggers webhooks.
// Source: https://github.com/savvyagents/larasend | License: MIT | Copyright 2026 Larasend
// Provided via justclaw.it.com; keep this notice with the code.
<?php
namespace App\Services;
use App\Jobs\DeliverInboundWebhook;
use App\Models\InboundEmail;
use App\Models\Source;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Throwable;
use ZBateson\MailMimeParser\Header\HeaderConsts;
use ZBateson\MailMimeParser\IMessage;
use ZBateson\MailMimeParser\MailMimeParser;
/**
* Provider-agnostic inbound pipeline: every receiving adapter (Cloudflare
* Worker today, SES/S3 or SMTP later) delivers an envelope plus raw MIME
* here, and everything downstream — storage, parsing, webhook fan-out —
* is shared.
*/
class InboundEmailIngestor
{
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key