Skip to content
Pre-release. HostCraft is in testing and not yet for sale. These docs describe the current build and may change. Join the waitlist to hear when it launches.

Mail

HostCraft ships a full email stack: Postfix for SMTP, Dovecot for IMAP/POP3, Rspamd for spam filtering, and SnappyMail for webmail. The panel manages all configuration through the configwriter pattern; operators do not edit Postfix or Dovecot configs directly.

The Emails page with Mailboxes, Forwarders, Mailing lists, Domains and Track delivery tabs and a mailbox table

Mailboxes, forwarders and domains are managed from the account Emails page.

Four record types are required for every domain that sends or receives mail on HostCraft. When you enable mail for a domain, the panel publishes these automatically if you use the HostCraft PowerDNS backend. For external DNS providers, copy the values from Mail -> DNS Records.

# MX: direct inbound mail to your server
@ MX 10 mail.<domain>.
# SPF: authorise your server to send from this domain
@ TXT "v=spf1 mx ~all"
# DKIM: cryptographic signing (selector format: hostcraftYYYYMM)
hostcraft202501._domainkey TXT "v=DKIM1; k=rsa; p=<base64-public-key>"
# DMARC: policy for unauthenticated mail
_dmarc TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@<domain>"

The panel checks each record against a live DNS lookup on a 6-hour ticker and shows a per-record green/amber/red indicator in Mail -> DNS Status.

Start with ~all (softfail) during cutover. After a week of clean SPF alignment, the panel offers a one-click upgrade to -all (hardfail). If the domain also sends through a third-party service:

v=spf1 include:_spf.mailchimp.com mx ~all

Start at p=none to collect aggregate reports without any enforcement. Move to p=quarantine after a clean week, then to p=reject once SPF, DKIM, and DMARC reports have been green for at least two weeks. The panel guides you through this ramp in Mail -> DMARC.

The panel can ingest DMARC aggregate reports back into the dashboard via the mail.dmarc.reports toolkit. Configure the report mailbox under Mail -> DMARC -> Report ingestion.

HostCraft uses the selector format hostcraftYYYYMM (for example hostcraft202501). This makes it easy to identify when a key was issued and whether old selectors should be retired.

  1. In the panel go to Mail -> DKIM -> Rotate.
  2. The panel generates a new 2048-bit RSA key with a new dated selector and publishes it to DNS (or shows the record to add if using external DNS).
  3. Wait for DNS propagation. The panel polls the authoritative nameserver and shows green when the new selector is visible.
  4. Click "Switch signing". Postfix now signs outbound mail with the new selector.
  5. Wait 48 hours. In-flight messages signed with the old key may still arrive at receivers during this window.
  6. Click "Retire old selector". The panel removes the old DNS record.

Both selectors remain in DNS and both are accepted by receivers during the dual-publish window. The panel surfaces a yellow banner if a rotation has been started but not completed.

The deliverability dashboard at /admin/mail/deliverability gives operators a centralised view of the server's sending health.

The Deliverability page with the summary cards and the warmup schedule

The panel resolves the reverse DNS (PTR) of the server's outbound IP and checks that it matches the HELO banner HostCraft uses (mail.<panel-hostname>). If they do not match, a red indicator appears with the exact PTR value to set at your VM or ISP provider. PTR mismatch causes outright rejection at Gmail and Microsoft 365.

The PTR check runs on a 6-hour ticker.

The panel submits a test message to mail-tester.com on a 24-hour schedule and surfaces the score (0-10). A score below 8 triggers a yellow alert with the failing checks listed.

Fresh IP addresses are not trusted by large receivers. HostCraft enforces a 6-week warmup ramp for any IP that has not previously sent mail. The ramp caps outbound volume per day and increases each week:

Week Daily cap
1 50 messages
2 200 messages
3 1,000 messages
4 5,000 messages
5 20,000 messages
6 50,000 messages

After week 6 the cap is lifted. The dashboard shows the current warmup week and today's send count against the cap. Messages queued beyond the cap are held and released the next day.

If you are migrating an existing IP with a good reputation, contact JCR support to bypass the warmup ramp. Attach documentation of the IP's previous sending history.

Seven real-time blocklists are checked daily:

  • Spamhaus ZEN (SBL, XBL, PBL combined)
  • Spamhaus DBL
  • Barracuda BRBL
  • SORBS DNSBL
  • MXToolbox Blacklist check
  • URIBL
  • Invaluement ivmSIP

A listing on any RBL fires a high-priority alert in the panel and an email to the server admin. The alert includes the RBL name, the listing reason (where the RBL provides it), and the delisting URL.

Recovery playbook:

  1. Identify the compromised account via the outbound monitor in the Security tab.
  2. Suspend the account to stop the mail flow.
  3. Clean the compromised site (use the Malware quarantine browser).
  4. Submit the delisting request through the RBL's form. Links are in the panel alert.
  5. After delisting, re-enable the account and monitor the bounce rate for 24 hours.

The panel tracks the bounce rate (hard bounces / total sent) on a rolling 7-day window. If the bounce rate exceeds 5%, a red alert fires. High bounce rates indicate either a list hygiene problem or an IP reputation issue. Senders above the red line have their outbound volume throttled automatically until the rate falls below 2%.

If Rspamd or an external FBL (feedback loop) reports a message hit a spam trap, the panel records the event and escalates the source account's bounce-rate threshold. Three spam-trap hits in a week trigger an automatic account review.

The dashboard queries Sender Score (senderscore.org) and Cisco Talos reputation for the server's IPs on a 24-hour interval. Scores are shown alongside the RBL status. A Sender Score below 70 triggers a yellow alert; below 50 triggers a red alert.

For a freshly provisioned server:

  1. Ensure PTR is set and matches the HELO banner before sending any mail.
  2. Add SPF, DKIM, and DMARC records for every sending domain.
  3. Start sending low-volume mail (newsletters, transactional) first. Do not blast cold lists.
  4. Watch the deliverability dashboard daily for the first two weeks.
  5. If an RBL listing appears in week 1 or 2, investigate immediately; warmup damage compounds.
  6. After week 6, confirm the mail-tester score and Sender Score are both in the green before opening up high-volume sending.

The installer downloads the latest SnappyMail release from GitHub, verifies its OpenPGP signature against the SnappyMail release key (1016E47079145542F8BA133548208BA13290F3EB), and serves it on the panel hostname at https://<panel-hostname>:2096/ (the same port cPanel uses for webmail). Set HOSTCRAFT_SNAPPYMAIL_VERSION before running the installer to pin a specific release.

How it runs:

  • Caddy terminates TLS on port 2096 and hands PHP to a dedicated PHP-FPM unit, hostcraft-webmail.service (PHP 8.4, or 8.5 when 8.4 is unavailable), running as the unprivileged hostcraft-webmail user.
  • Code lives in /var/lib/hostcraft-webmail/public (root owned, read only). SnappyMail data lives in /var/lib/hostcraft-webmail/data, outside the document root.
  • Every mailbox logs in against the local Dovecot over IMAPS (127.0.0.1:993) and sends through Postfix submission (127.0.0.1:587, STARTTLS, SMTP AUTH).
  • The SnappyMail admin panel is disabled, its URL key is randomised, and its admin password is a generated secret stored in /etc/hostcraft/webmail/admin.secret (root only).

Single sign on: POST /api/v1/mail/mailboxes/{id}/webmail-session returns a 15 minute, single use URL (https://<panel-hostname>:2096/?session=<jwt>). The HostCraft bridge (webmail-bootstrap.php, written by hostcraftd at boot) verifies the JWT with the key in /etc/hostcraft/webmail/, decrypts the mailbox credential, and signs the browser into SnappyMail. A link that was already used is rejected. Set mail.webmail_url in config.yaml only if you serve webmail from your own vhost; the daemon then leaves the Caddy webmail site alone.

The token cannot be used against the panel API.

The Postfix queue surfaces in the panel under Mail -> Queue. Each message shows sender, recipient, queue age, and the most recent delivery error.

The Mail queue page with state counters, queue depth chart and the queue table

Action CLI equivalent Effect
Flush postqueue -f Force immediate retry of all queued messages
Hold postsuper -h <id> Move message to the hold queue (paused)
Release postsuper -H <id> Move from hold back to the active queue
Delete postsuper -d <id> Permanently remove the message
Delete all postsuper -d ALL Requires typed confirmation in the panel
Terminal window
# CLI: list the queue
hostcraftd mail queue list
# CLI: delete a specific message
hostcraftd mail queue delete --id=<queue-id>
# CLI: flush the queue
hostcraftd mail queue flush

Bulk actions on more than 100 messages require a re-typed confirmation string in the panel. Deleting more than 1,000 messages from the CLI requires the --force flag.

Rspamd handles spam scoring with per-user Bayesian training, per-IP and per-domain reputation, and content-based scoring. The Rspamd web UI is available at Security -> Mail filter in the panel.

Per-user or per-account whitelist:

Terminal window
hostcraftd mail rspamd whitelist add \
--account=acme \
--pattern="[email protected]"

Rspamd config is always written through the configwriter pattern; do not edit Rspamd config files directly.