Check mail-domain DNS and provide provider setup records
Coulobre Panel CI / Checks (Python 3.12) (pull_request) Canceled after 0s
Coulobre Panel CI / Checks (Python 3.14) (pull_request) Canceled after 0s

This commit is contained in:
parkel committed 2026-11-21 22:04:15 +01:00
1 parent 004a8b4d81
commit ef95ed9521
11 files changed
+915 -6

No files matched your search

+114
View File
@@ -993,6 +993,120 @@ Back up mail on the node that hosts the mailbox. The archive can be used to
recover messages and folders into a newly provisioned mailbox with the same
address. [Mailbox backup and restore](development.md#back-up-and-restore-a-mailbox)
## Check and provision mail DNS
Open **Check mail DNS** under **Mail domains**. The check reads MX and
its address records, SPF, DMARC, DKIM public keys, the MTA-STS and TLS-RPT
DNS records, and reverse DNS for configured sending addresses. Use the
DKIM selector supplied by the signer or the `s=` value from a sent
message's `DKIM-Signature` header. Coulobre fills in selectors it knows.
The panel uses its system resolver by default. For internet-facing mail,
set `COULOBRE_MAIL_DNS_RESOLVERS` to a comma-separated list of up to three
trusted recursive resolvers with a public DNS view. An authoritative-only
BIND instance serves zones and may not answer queries for other domains.
Results describe the returned records and their basic validity. Verify
SPF evaluation, DKIM signatures, DMARC alignment and mail delivery with a
message sent to an independent mailbox. The MTA-STS check reads its DNS
policy ID. Checking the HTTPS policy is a separate step. The DKIM check
compares the managed selector with the public key received from the mail
node.
### Set up signing on a Coulobre mail node
Install the distribution's `rspamd` package on the mail node, including
when the node is separate from the panel. This example dedicates Rspamd
to signing authenticated Postfix submission. It uses a private Postfix
socket and disables Rspamd's normal and controller listeners. The
mail host can still use [SpamAssassin for incoming SMTP](#filter-incoming-mail-with-spamassassin).
[Rspamd signing options](https://docs.rspamd.com/modules/dkim_signing/)
```sh
sudo apt install rspamd
sudo install -d -o root -g _rspamd -m 0750 /etc/rspamd/coulobre-dkim
sudo install -d -o root -g postfix -m 0750 /var/spool/postfix/rspamd
sudo install -m 0644 deploy/rspamd/dkim_signing.conf.example \
/etc/rspamd/override.d/dkim_signing.conf
sudo install -m 0644 deploy/rspamd/worker-proxy.inc.example \
/etc/rspamd/override.d/worker-proxy.inc
for worker in normal controller; do
sudo install -m 0644 deploy/rspamd/worker-disabled.inc.example \
"/etc/rspamd/override.d/worker-$worker.inc"
done
sudo install -m 0644 deploy/rspamd/settings.conf.example \
/etc/rspamd/local.d/settings.conf
sudo rspamadm configtest
sudo systemctl enable rspamd.service
sudo systemctl restart rspamd.service
```
Configure TLS for Postfix and include
`deploy/dovecot/submission-auth.conf.example` in the Dovecot configuration
to provide the SASL socket. Use full email addresses for authentication.
Merge `deploy/rspamd/postfix-submission.cf.example` into the
`submission` service in `/etc/postfix/master.cf`. Use the signing socket
only from authenticated submission. Keep any inbound milters on the
public SMTP service. Rspamd signs when the authenticated domain,
envelope sender domain, and header sender domain agree.
[Postfix SASL setup](https://www.postfix.org/SASL_README.html)
```sh
sudo systemctl restart dovecot.service
sudo postfix check
sudo postfix reload
```
Configure the panel and mailbox worker in `/etc/coulobre/panel.env`.
Set the inbound hostname separately from the sending addresses. Set
`COULOBRE_MAIL_MX_IPS` when Coulobre should also create address records for
an MX hostname inside the managed zone. Ensure an MX hostname outside
the zone already has public addresses at its DNS provider. Replace the
documentation addresses below with the real public addresses.
```ini
COULOBRE_MANAGE_MAIL_DNS=1
COULOBRE_MAIL_MX_HOST=mx.example.net
COULOBRE_MAIL_MX_IPS=192.0.2.25
COULOBRE_MAIL_SENDING_IPS=192.0.2.25,2001:db8::25
```
Upgrade Coulobre on the panel and mail node, apply migrations, collect
static files and restart the panel, workers and scheduler. Provisioning a
mailbox creates or reuses a per-domain RSA DKIM key with selector
`coulobre`. The signing key stays on the mail node. Include
`/etc/rspamd/coulobre-dkim` in the operator's protected configuration
backup. For an existing mailbox, an operator can run **Refresh mail DNS
setup** on the domain's checker page.
### Publish records with Coulobre DNS
Enable the local or SSH-backed DNS publishing worker and select
**Publish DNS for Coulobre mail automatically** in the zone's editor.
Provision a mailbox or refresh its mail DNS setup. Coulobre adds the MX
record, any needed in-zone addresses, an SPF policy for the configured
sending IPs, a monitoring DMARC record, and the DKIM public key. It
queues the revised zone through the configured DNS worker.
The job waits for a publishing request already in progress. Publish
unpublished zone edits before applying a conflicting mail setup. Review
existing MX or DKIM conflicts from the checker page. Coulobre preserves
existing SPF and DMARC policies. When other systems also send for the
domain, include them in SPF before asking receivers to enforce DMARC.
Configure PTR with the provider that assigns the public sending IP.
### Publish records with third-party DNS
The checker shows the DNS zone and nameservers observed by the resolver.
Open the DNS editor at the company hosting that zone. Use the registrar's
editor when the registrar also runs its nameservers. Leave automatic
publishing off for a zone hosted by a third party.
Copy the record names, values, and MX priorities from **Where to edit
DNS**. Use the full record name or the relative name expected by the
provider. Keep one SPF policy and merge all authorized senders into it.
For a third-party signer, use its exact DKIM TXT or CNAME records. Publish
the records and run the checker again after the old TTL has expired.
## Filter incoming mail with SpamAssassin
Install the distribution's SpamAssassin and `spamass-milter` packages on