Enforce mailbox storage quotas from hosting plans #30

Merged
parkel merged 3 commits from feature/mailbox-storage-quotas into main 2026-11-21 13:22:31 +01:00
2 changed files with 44 additions and 2 deletions
Showing only changes of commit eb6595e0ef - Show all commits

No files matched your search

+4
View File
@@ -478,6 +478,10 @@ The initial password stays in the root-only credentials file on the mail node.
To locate that file, download the manifest and use the node's `apply` command.
Reapplying the manifest preserves the password and prints the file path.
Set a per-mailbox storage limit on the hosting plan for new mailbox requests.
Enable Dovecot quota enforcement on the mail node before provisioning them.
[Mailbox storage limits](development.md#enforce-mailbox-storage-limits)
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)
+40 -2
View File
@@ -30,9 +30,14 @@ plan have unlimited requests. The account page shows usage for configured
limits. Mailboxes count toward the same limit across all of an account's mail
domains, including domains retained after a primary domain change.
Set **Mailbox storage limit (MiB)** to assign a Dovecot storage quota to each
new mailbox requested under the plan. The account page shows each mailbox's
assigned limit. Leave the field blank to omit a Coulobre storage limit.
[Configure Dovecot quota enforcement](#enforce-mailbox-storage-limits)
Changing or reassigning a plan preserves existing databases and mailboxes. If
the new limit is at or below current usage, the panel blocks additional
requests of that type.
requests of that type. Storage limit changes apply to new mailbox requests.
## Give a reseller access to assigned accounts
@@ -363,6 +368,8 @@ Existing mailbox requests keep their addresses when the primary domain changes.
The **Mailbox requests** table shows the email addresses. Operators can
download a versioned manifest that contains the domain and local part.
Resellers can see mailbox requests on their assigned accounts.
Version 2 adds `quota_mib` for mailboxes with a storage limit. Version 1
manifests continue to apply with no Coulobre storage limit.
Run the installed node command to validate the manifest and display its
address. The manifest describes a virtual user for the Postfix and Dovecot
@@ -448,6 +455,37 @@ For an existing mail node, follow the
[Dovecot upgrade guide](https://doc.dovecot.org/2.4.2/installation/upgrade/2.3-to-2.4.html)
to migrate its configuration and retain its Maildirs and Coulobre registry.
#### Enforce mailbox storage limits
Use Dovecot's count quota driver for mailbox storage limits. The
[Dovecot 2.4 example](../deploy/dovecot/coulobre-2.4.conf.example) enables
quota enforcement and reports usage to IMAP clients. Keep the quota's default
storage size unlimited so mailbox-specific limits come from Coulobre.
[Dovecot 2.4 quota configuration](https://doc.dovecot.org/2.4.2/core/plugins/quota.html)
On Dovecot 2.3, merge these settings into the mail node configuration.
```text
mail_plugins = $mail_plugins quota
protocol imap {
mail_plugins = $mail_plugins imap_quota
}
plugin {
quota = count:User quota
quota_vsizes = yes
quota_grace = 0
}
```
Reload Dovecot after updating its configuration. The examples disable the
delivery grace allowance so LMTP and IMAP enforce the assigned limit. To
see the usage and limit of a live mailbox, run
`sudo doveadm quota get -u support@example.net`.
[Dovecot 2.3 quota configuration](https://doc.dovecot.org/2.3/configuration_manual/quota/)
After upgrading a mail node from Dovecot 2.3 to 2.4, reapply a managed mailbox
manifest to republish the lookup table with the new quota setting syntax.
#### Install the mailbox
Start Postfix first to initialize its spool directory, then start Dovecot so
@@ -535,7 +573,7 @@ sudo systemctl enable --now coulobre-mail-apply.socket
```
Grant the socket group only to the service identity responsible for mailbox
provisioning. Send one version 1 mailbox manifest as UTF-8 JSON to
provisioning. Send one version 1 or 2 mailbox manifest as UTF-8 JSON to
`/run/coulobre-mail-apply.sock`, with a limit of 4 KiB. Shut down the writing
half of the connection and read the JSON reply to EOF. For a valid manifest,
the reply identifies the mailbox and reports `configured` or `failed`.