wambacom/smtpd 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

wambacom/smtpd

Composer 安装命令:

composer require wambacom/smtpd

包简介

Fork thefox/smtpd. SMTP server (library) written in PHP. In this fork we use eXorus/php-mime-mail-parser as mail parser instead of zend::message

README 文档

README

SMTP server (library) written in PHP. This library only provides an interface to the SMTP protocol with PHP. You need to deliver the mails by yourself.

Why this project?

Believe it or not, email is still the killer feature of the Internet. There are tons of projects like PHPMailer: to send emails programmatically (with PHP). But there are not so many to receive emails from SMTP.

With this interface you can do something like this for your app users:

User <-> MUA (like Thunderbird) <-> SMTP <-> Your PHP App

This is useful when you have a messaging application written in PHP but no graphical user interface for it. So your graphical user interface can be any email client. Thunderbird for instance.

Installation

The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to composer.json:

composer.phar require "thefox/smtpd=~0.1"

Stand-alone server

  1. Clone project from GitHub.

    git clone https://github.com/TheFox/smtpd.git

  2. Install dependencies.

    make

  3. To start a stand-alone server you can type the following command in your shell:

    ./application.php server -d

    To show the usage options use -h:

    ./application.php server -h

    You can change the IP and port. Default port is 20025.

    ./application.php server -a 0.0.0.0 -p 25

Note: The stand-alone server is only for testing. If you want to use it for production you need to define a save/deliver function. See example below.

Usage

Use this library to provide an IMAP server in your own project.

<?php
require_once __DIR__.'/vendor/autoload.php';
use TheFox\Smtp\Server;
use TheFox\Smtp\Event;

$server = new Server('127.0.0.1', 20025);
$server->init();
$server->listen();

$event1 = new Event(Event::TRIGGER_MAIL_NEW, null, function($event, $from, $rcpt, $mail){
	// Do stuff: DNS lookup the MX record for the recipient's domain, ...
});
$server->eventAdd($event1);

$server->loop();

loop() is only a loop with run() executed. So you need to execute run() in your own project to keep the SMTP server updated.

RFC 821 Implementation

Complete implementation

  • 3.5 OPENING AND CLOSING

Incomplete implementation

  • 3.1 MAIL
  • 4.1.1 COMMAND SEMANTICS
    • HELO
    • MAIL
    • RCPT
    • DATA
    • NOOP
    • QUIT

RFC 1651 Implementation

Complete implementation

  • 4.1.1 First command
  • 4.5 Error responses from extended servers

Related Projects

Contribute

You're welcome to contribute to this project. Fork this project at https://github.com/TheFox/smtpd. You should read GitHub's How to Fork a Repo.

License

Copyright (C) 2014 Christian Mayer http://fox21.at

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

wambacom/smtpd 适用场景与选型建议

wambacom/smtpd 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.82k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2014 年 11 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「mail」 「email」 「server」 「smtp」 「daemon」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 wambacom/smtpd 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 wambacom/smtpd 我们能提供哪些服务?
定制开发 / 二次开发

基于 wambacom/smtpd 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.82k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 18
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 4
  • Forks: 31
  • 开发语言: PHP

其他信息

  • 授权协议: GPLv3
  • 更新时间: 2014-11-10