cryodrift/mailserver 问题修复 & 功能扩展

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

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

cryodrift/mailserver

最新稳定版本:0.1.13

Composer 安装命令:

composer require cryodrift/mailserver

包简介

simple pop3 and smtp servers with encryption

README 文档

README

Minimal POP3 and SMTP servers intended for local account-setup and client integration tests. POP3 serves messages from a filesystem maildir. SMTP accepts messages and relays them using src/mail/Smtp.

This is not for production use.

What it does

  • POP3: Listens on a TLS socket (implicit TLS) — default 0.0.0.0:1995.
  • POP3: Serves messages from a configurable maildir directory (recursively scanned, oldest first).
  • POP3: Accepts any USER/PASS (no verification) — for testing only.
  • POP3: Supports core commands: CAPA, USER, PASS, STAT, LIST, UIDL, RETR, TOP, NOOP, RSET, QUIT.
  • SMTP: Listens on implicit TLS (default 0.0.0.0:465). Accepts EHLO/HELO, AUTH (accepts any), MAIL FROM, RCPT TO, DATA, RSET, NOOP, QUIT.
  • SMTP: On end of DATA, relays via \cryodrift\mail\Smtp using configured user accounts.
  • SMTP (receiver mode): Optionally saves each received message to a Maildir so POP3 can serve it.
  • POP3: Multi-line responses and dot-stuffing per POP3.

Requirements

  • PHP 8.4+
  • TLS certificate and key files (self-signed is fine for local testing)
  • A maildir-like folder with message files (POP3)
  • add domain to hosts eg: 127.0.0.1 mail.lab.lan
  • create cert for this domain

Minimal usage examples

POP3

php vendor/bin/cryodrift.php -echo /mailserver/cli/ pop3

SMTP

php vendor/bin/cryodrift.php -echo /mailserver/cli/ smtp

Connecting for quick tests

POP3 over TLS (implicit):

openssl s_client -connect 127.0.0.1:1995 -quiet

SMTP over TLS (implicit):

openssl s_client -connect 127.0.0.1:465 -quiet
EHLO localhost
AUTH PLAIN
MAIL FROM:<test@example.com>
RCPT TO:<dest@example.com>
DATA
Subject: hello

body
.
QUIT

Maildir notes (POP3)

  • The server recursively scans the configured maildir and serves every file it finds as a message.
  • Messages are sorted by file modification time (oldest first).
  • UIDL uses the filename (before any :2, suffix) for stability.

Limitations

  • POP3: No user authentication or authorization (accepts any credentials). Read-only (DELE disabled).
  • SMTP: Accepts any AUTH and relays based on local account config; intended only for local tests.
  • Designed for local/test environments only.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固