定制 sendity/email-channel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sendity/email-channel

Composer 安装命令:

composer require sendity/email-channel

包简介

Framework-agnostic Sendity inbound email channel for raw RFC822 messages, DKIM verification, MIME parsing, and code extraction.

README 文档

README

Framework-agnostic PHP package for Sendity inbound email verification.

sendity/email-channel accepts raw RFC822/MIME messages from an SMTP transport, verifies DKIM sender-domain alignment with dachs/mail-auth, parses message content with an established MIME parser, extracts Sendity authentication codes through the sendity/core AuthCodeServiceInterface contract, and returns a normalized email-channel result.

Boundaries

This package intentionally contains no Laravel/server glue and no persistence/session matching. sendity/laravel-server is responsible for wiring this package into the application, mapping the normalized result into server-side verification flows, and handling storage/events/jobs.

Dependencies on sendity/core are limited to contracts/interfaces. The package does not depend on Sendity server internals.

Basic usage

use Dachs\MailAuth\DkimVerifier;
use Sendity\Core\Contract\AuthCodeServiceInterface;
use Sendity\EmailChannel\EmailChannel;
use Sendity\EmailChannel\SmtpEnvelopeContext;

/** @var AuthCodeServiceInterface $authCodeService */
$channel = new EmailChannel(
    authCodeService: $authCodeService,
    dkimVerifier: new DkimVerifier(),
);

$result = $channel->processRawMessage(
    rawMessage: $rawRfc822Message,
    context: new SmtpEnvelopeContext(
        recipient: 'login@sendity.io',
        mailFrom: $smtpMailFrom,
        remoteAddress: $smtpRemoteAddress,
    ),
);

if ($result->status === \Sendity\EmailChannel\EmailProcessingStatus::Verified) {
    // Hand off $result->sender, $result->codes and $result->identityData to the server glue.
}

Verification policy

A verified result requires:

  • raw message size within EmailChannelOptions::$maxMessageBytes
  • DKIM verification pass via dachs/mail-auth
  • DKIM signing domain aligned with the visible From domain
  • parseable MIME content
  • visible sender email address
  • at least one extractable Sendity code

DMARC is intentionally not enforced here; this matches the current Sendity email-inbound MVP contract.

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 9
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-11