local-mail-server
本地邮件服务器系统,基于 Stalwart Mail Server + Brevo 中继 + VPS 中继。支持完整的邮件收发功能,适用于无公网 IP 环境。触发词:邮件服务器、email、imap、smtp、stalwart、brevo、vps relay。
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/franklili3/local-mail-server本地邮件服务器(无公网 IP 方案)
基于 Stalwart Mail Server 的本地邮件系统,配合 Brevo 发件中继和 VPS 收件中继,实现完整的邮件收发功能。
适用场景:家庭网络、运营商 NAT 环境、无公网 IP
架构概览
┌─────────────────────────────────────────────────────────────────┐
│ 本地服务器 (Mac/Linux) │
│ │
│ Webmail/IMAP客户端 ──IMAP──► Stalwart ──Brevo──► 外部收件人 │
│ │ │ │
│ └── 显示/管理邮件 └── 存储/转发邮件 │
└─────────────────────────────────────────────────────────────────┘
▲
│ Tailscale VPN (私有网络 IP)
│
┌─────────────┴───────────────────────────────────────────────────┐
│ VPS (公网 IP) │
│ │
│ Postfix 中继 ──► DKIM 验证 ──► Tailscale ──► 本地服务器 │
│ ▲ │
│ │ │
│ 外部邮件 (Gmail/QQ Mail 等) │
└─────────────────────────────────────────────────────────────────┘
收件: 外部发件人 → DNS MX → VPS Postfix → Tailscale VPN → 本地 Stalwart
发件: Webmail → Stalwart (SMTP) → Brevo 中继 → 外部收件人
系统要求
本地服务器
- macOS / Linux
- Stalwart Mail Server 0.15.5+
- Tailscale(用于 VPS 通信)
VPS
- 任意云服务商(Vultr/DigitalOcean/腾讯云等)
- Ubuntu 24.04 LTS
- 公网 IP
- 最小配置即可(1核 512MB 内存)
外部服务
- Brevo 账户(免费 300 封/天)
- Cloudflare DNS(管理域名)
- Tailscale 账户(免费)
快速开始
1. 安装 Stalwart
# macOS ARM64
curl -L -o stalwart.tar.gz "https://github.com/stalwartlabs/stalwart/releases/download/v0.15.5/stalwart-aarch64-apple-darwin.tar.gz"
# Linux x86_64
curl -L -o stalwart.tar.gz "https://github.com/stalwartlabs/stalwart/releases/download/v0.15.5/stalwart-x86_64-unknown-linux-gnu.tar.gz"
tar -xzf stalwart.tar.gz
chmod +x stalwart
./stalwart -c config/config.toml
2. 配置 VPS 中继
# 在 VPS 上安装 Postfix 和 OpenDKIM
sudo apt update
sudo apt install -y postfix opendkim opendkim-tools
# 配置 Postfix 转发到本地服务器
echo "yourdomain.com smtp:[LOCAL_TAILSCALE_IP]:25" | sudo tee /etc/postfix/transport
sudo postmap /etc/postfix/transport
3. 配置 DNS
在 Cloudflare DNS 添加:
类型 名称 内容
───────────────────────────────────────────────────────────
MX @ mail.yourdomain.com (优先级 10)
A mail YOUR_VPS_IP (仅 DNS,灰色云朵)
TXT @ v=spf1 ip4:YOUR_VPS_IP include:spf.brevo.com ~all
TXT _dmarc v=DMARC1; p=none; rua=mailto:[email protected]
TXT mail._domainkey DKIM 公钥
配置详解
Stalwart 配置 (config/config.toml)
# 服务器基本配置
server.hostname = "mail.yourdomain.com"
server.listener.smtp.bind = ["[::]:25"]
server.listener.imap.bind = ["[::]:143"]
server.listener.submission.bind = ["[::]:587"]
# Brevo 发件中继
[relay.brevo]
address = "smtp-relay.brevo.com"
port = 587
protocol = "smtp"
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-franklili3-local-mail-server": {
"enabled": true,
"auto_update": true
}
}
}Tags
Related Skills
Meeting Brief Copilot
Turn people, companies, agendas, notes, and email threads into consulting-style meeting briefs, sharp questions, follow-up emails, and action items.
cold-outreach-pack
Cold email, LinkedIn outreach, and follow-up sequences for sales and networking. Professional templates and best practices.
webinar-warrior
Autonomous webinar strategy and content builder for coaches, course creators, community builders, and service providers. Use this skill immediately when the user asks to build a webinar, create a webinar strategy, write webinar emails, design a webinar offer, build a webinar funnel, write a webinar script, create a slide deck outline, or plan a product launch presentation. Also triggers for any conversation about selling from stage, live training strategy, converting an audience to buyers, building a high-ticket offer, or the phrases perfect webinar, webinar funnel, or live training. Built by Adrian Boysel at Brand Butler.
follow-up-commander
把会后事项拆成行动清单、催办节奏、邮件草稿和下次同步议题。;use for followup, meeting, email workflows;do not use for 直接发送邮件, 伪造完成状态.
OPC Essentials
A premium operating system skill for one-person companies covering triage, pipeline, sales calls, proposals, follow-ups, renewals, cash collection, weekly and monthly reviews, and practical solo-founder decisions.