stalwart-dokploy-resend-relay
Skill1 starsChanged 5 months agoMITView on GitHub
Set up Stalwart Mail Server on a new VPS via Dokploy, with default outbound delivery through Resend SMTP relay for environments where direct SMTP port 25 egress is blocked.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Fei2-Labs/skill-genieword for word, first seen Sep 24, 2026
Other versions1 project uses a version of this.
Word for word · 1
- Fei2-Labs/skill-genie★ 12100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- aegis-protocolSkill
- ai-csuiteSkill
- browser-driverSkill
- chinese-humanizerSkill
- close-loopSkill
- de-ai-englishSkill
- dev-inboxSkill
- foxcode-openclawSkill
- git-cryptSkill
- handoff-receiverSkill
- image-prompt-engineerSkill
- init-rulesSkill
- linuxdo-applicationSkill
- npm-publishSkill
- omnidebug-autopilotSkill
- psychology-masterSkill
- refactor-agents-mdSkill
- research-to-wechatSkill
- rtk-token-saverSkill
- session-handoffSkill
- shared-memorySkill
- web-compliance-builderSkill
- wechat-compliance-checkSkill
- wordpress-vps-installSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
31 rules. About 0 are common, 23 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈23
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill to deploy a production-ready Stalwart server on a new VPS managed by Dokploy.
- Distinctive: line 45
Before any configuration changes, run all checks below.
- Distinctive: line 59
stop and prompt user to fix DNS first
- Distinctive: line 75
if user approves auto-install, install and verify Dokploy before continuing
- Distinctive: line 90
if approved, deploy Stalwart and continue
- Distinctive: line 94
Use this exact branching logic:
- Distinctive: line 96
If MX is incorrect:
- Distinctive: line 97
do not proceed with mailbox validation
- Distinctive: line 99
wait for user confirmation and re-check
- Distinctive: line 102
ask user whether to install automatically
- Distinctive: line 103
if yes, install Dokploy and verify
- Distinctive: line 104
if no, stop with clear manual prerequisites
- Distinctive: line 107
ask user whether to install automatically in Dokploy
- Distinctive: line 108
if yes, deploy Stalwart and verify
- Distinctive: line 109
if no, stop with required manual steps
- Distinctive: line 111
Only continue to next phases when all three preflight checks pass.
- Distinctive: line 115
Add/verify these records:
- Very specific: line 130
Keep existing Resend send-domain records (send.<domain> MX/SPF/DKIM) if used.
- Very specific: line 135
Use Stalwart image (stalwartlabs/stalwart:latest-alpine)
- Distinctive: line 139
If bootstrap keeps resetting after restart, fix volume ownership:
- Very specific: line 156
Use Let’s Encrypt for mail.<domain>:
- Very specific: line 164
If the UI create form rejects the PEM with No certificates found in PEM, create the certificate through the JMAP x:Certificate/set endpoint …
- Distinctive: line 183
Verify auth from server side:
- Distinctive: line 195
When port 25 egress is blocked, do not use direct MX delivery route for outbound.
- Very specific: line 199
Create route relay (@type: Relay):
- Very specific: line 206
Update x:MtaOutboundStrategy route expression:
- Distinctive: line 207
keep local delivery rule for local domains
- Very specific: line 245
If messages stay Scheduled too long, inspect route/worker status and restart service.
- Distinctive: line 253
Use manual settings (autodiscovery may fail):
- Distinctive: line 259
If direct outbound delivery remains blocked and Stalwart queue is not healthy, temporary fallback:
- Very specific: line 274
If the UI errors with No certificates found in PEM, use JMAP x:Certificate/set with the leaf PEM + private key, then restart Stalwart
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stalwart on Dokploy (Resend Relay Default)
Use this skill to deploy a production-ready Stalwart server on a new VPS managed by Dokploy.
Default assumption:
- outbound SMTP port
25is blocked by provider/network - outbound mail must go through
smtp.resend.com:587
Scope
This skill covers:
- preflight validation (MX, Dokploy, Stalwart)
- Stalwart deployment on Dokploy
- domain + DNS records for mailbox hosting
- TLS certificate setup for mail/web endpoints
- mailbox and admin provisioning
- relay route to Resend SMTP
- verification for IMAP/SMTP and queue behavior
Triggers
- "set up stalwart on new vps"
- "install mail server on dokploy"
- "stalwart with resend relay"
- "smtp 25 blocked setup"
- "host support@ mailbox on vps"
Required Inputs
- Domain: e.g.
example.com - Mail host: e.g.
mail.example.com - VPS SSH access
- Dokploy access
- Resend API key
Mandatory Preflight (Run First)
Before any configuration changes, run all checks below.
1. DNS/MX check
dig +short MX <domain>
dig +short A mail.<domain>Pass criteria:
- MX includes
mail.<domain>with valid priority mail.<domain>resolves to VPS public IP
If fail:
- stop and prompt user to fix DNS first
- optionally offer to provide exact records to add
2. Dokploy existence check
On VPS:
docker ps --format '{{.Names}} {{.Image}}' | grep -i dokployPass criteria:
- Dokploy services are running
If fail:
- prompt user: install Dokploy now?
- if user approves auto-install, install and verify Dokploy before continuing
3. Stalwart existence check
On VPS:
docker ps --format '{{.Names}} {{.Image}}' | grep -i stalwartPass criteria:
- existing Stalwart service/container found
If fail:
- prompt user: install Stalwart automatically via Dokploy now?
- if approved, deploy Stalwart and continue
Decision Flow (Required)
Use this exact branching logic:
- If MX is incorrect:
- do not proceed with mailbox validation
- provide DNS fix instructions
- wait for user confirmation and re-check
- If Dokploy missing:
- ask user whether to install automatically
- if yes, install Dokploy and verify
- if no, stop with clear manual prerequisites
- If Stalwart missing:
- ask user whether to install automatically in Dokploy
- if yes, deploy Stalwart and verify
- if no, stop with required manual steps
Only continue to next phases when all three preflight checks pass.
DNS Baseline
Add/verify these records:
- Mail host A:
mailA-><VPS_PUBLIC_IP>
- Inbound MX:
@MXpriority10->mail.<domain>
- SPF for domain:
@TXT->v=spf1 mx include:amazonses.com -all
- DMARC starter:
_dmarcTXT->v=DMARC1; p=none;
Notes:
- Keep existing Resend send-domain records (
send.<domain>MX/SPF/DKIM) if used. - Root-domain MX for mailbox hosting and
send.<domain>MX for sending workflows can coexist.
Deploy Stalwart in Dokploy
- Use Stalwart image (
stalwartlabs/stalwart:latest-alpine) - Expose/route ports:
25,465,587,993,8080,443 - Persist volumes for
/etc/stalwart,/var/lib/stalwart,/opt/stalwart-mail
If bootstrap keeps resetting after restart, fix volume ownership:
sudo chown -R 2000:2000 /var/lib/docker/volumes/<stalwart-volume>/_dataStalwart Bootstrap
- Complete bootstrap once (default domain, hostname, internal directory)
- Confirm admin account is persistent after restart
Target settings:
- default hostname:
mail.<domain> - default domain:
<domain>
TLS Certificate (must not be self-signed)
Use Let’s Encrypt for mail.<domain>:
sudo certbot certonly --standalone -d mail.<domain> --non-interactive --agree-tos -m support@<domain>Then import the cert into Stalwart certificate store and set as defaultCertificateId.
If the UI create form rejects the PEM with No certificates found in PEM, create the certificate through the JMAP x:Certificate/set endpoint instead, using the leaf certificate PEM and private key, then set x:SystemSettings.defaultCertificateId to the created certificate object ID and restart Stalwart so 465/993 pick up the new cert.
Verify:
openssl s_client -connect mail.<domain>:465 -servername mail.<domain> < /dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates
openssl s_client -connect mail.<domain>:993 -servername mail.<domain> < /dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -datesExpected:
- CN includes
mail.<domain> - issuer is Let’s Encrypt (not self-signed)
Create Mailboxes
Create at least:
- admin mailbox (e.g.
admin@<domain>) - support mailbox (e.g.
support@<domain>)
Verify auth from server side:
# IMAP auth test
openssl s_client -quiet -crlf -connect 127.0.0.1:<mapped-993> <<<'a1 LOGIN support@<domain> <password>'
# SMTP auth test
# AUTH PLAIN with base64(\0user\0pass)Critical Default: Outbound Relay via Resend
When port 25 egress is blocked, do not use direct MX delivery route for outbound.
Configure in Stalwart:
- Create route
relay(@type: Relay):
- address:
smtp.resend.com - port:
587 - implicitTls:
false - authUsername:
resend - authSecret:
<RESEND_API_KEY>
- Update
x:MtaOutboundStrategyroute expression:
- keep local delivery rule for local domains
- set default route
elseto'relay'
Resulting behavior:
- local recipient domains -> local route
- external recipients -> Resend relay route
Web Admin Routing (Dokploy)
Map host to Stalwart web service (container port 8080):
- Host:
mail.<domain> - Path:
/ - Internal Path:
/ - HTTPS: enabled
- Redeploy after domain change
Admin UI URL:
https://mail.<domain>/admin/
Verification Checklist
- DNS:
dig +short MX <domain>
dig +short A mail.<domain>- Ports:
nc -zv mail.<domain> 993
nc -zv mail.<domain> 465
nc -zv mail.<domain> 25- IMAP/SMTP login works for
support@<domain>. - Queue health:
x:QueuedMessage/getshould not accumulate permanentTemporaryFailureentries.- If messages stay
Scheduledtoo long, inspect route/worker status and restart service.
- End-to-end test:
- send external test mail from Thunderbird and verify delivery
- send inbound test to
support@<domain>and verify receipt
Thunderbird Client Settings
Use manual settings (autodiscovery may fail):
- IMAP:
mail.<domain>/993/SSL/TLS/Normal password - SMTP:
mail.<domain>/465/SSL/TLS/Normal password - username: full email address
If direct outbound delivery remains blocked and Stalwart queue is not healthy, temporary fallback:
- SMTP server in client:
smtp.resend.com - port:
465(SSL/TLS) or587(STARTTLS) - username:
resend - password: Resend API key
Common Failure Modes
- Bootstrap not persisting
- Cause: wrong volume permissions
- Fix:
chownvolumes to stalwart user (2000:2000)
- TLS cert mismatch/self-signed
- Cause: default cert still active
- Fix: import LE cert and set default certificate in
x:SystemSettings - If the UI errors with
No certificates found in PEM, use JMAPx:Certificate/setwith the leaf PEM + private key, then restart Stalwart
- External send fails, queue error
Network unreachable (os error 101)
- Cause: blocked outbound 25
- Fix: force outbound route to Resend relay
- Inbound mail not arriving
- Cause: MX or port 25 path wrong/firewall
- Fix: validate DNS MX + open/route tcp 25 end-to-end
Exit Criteria
Complete when:
- preflight checks all pass (MX, Dokploy, Stalwart)
https://mail.<domain>/admin/opens- valid LE cert is presented on 465/993/443
support@<domain>can authenticate over IMAP/SMTP- inbound mail to
support@<domain>is received - outbound to external recipients is delivered via relay without queue stall
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

