Account Quotas
Mailbox quotas control the maximum amount of disk space a single email account can consume. Quotas are stored in the mail_accounts.quota_mb column and enforced by Dovecot's quota plugin, which reads the value from the database via its MySQL lookup.
How Quotas Work
Incoming message arrives at Postfix
↓
Postfix delivers to Dovecot's LDA (or LMTP)
↓
Dovecot checks quota_mb from mail_accounts table
↓
If under quota: deliver to Maildir
If over quota: reject with 452 "Mailbox full" error
↓
Postfix bounces with "over quota" NDR to sender
The quota check happens at delivery time. Dovecot does not need to be restarted when quota values change — the quota plugin queries the database on each delivery attempt, so updates take effect for the next incoming message.
Quota Units
All quota values in Opterius Mail are in megabytes (MB).
| Value | Meaning |
|---|---|
0 |
Unlimited — no quota enforced |
500 |
500 MB (approximately 0.5 GB) |
2048 |
2 GB |
10240 |
10 GB |
Common starting points: shared hosting accounts typically start at 500 MB–2 GB. Power users and business accounts often need 5–25 GB.
Setting a Quota
For a New Account
When creating an account in Admin → Accounts → Add Account, enter the quota in MB in the Quota field. Leave it at 0 for unlimited.
For an Existing Account
- Go to Admin → Accounts.
- Click the account's email address.
- Update the Quota (MB) field.
- Click Save.
The change takes effect immediately for new incoming messages. There is no need to flush any cache or restart Dovecot.
Bulk Quota Changes
To set the same quota for multiple accounts at once:
- In Admin → Accounts, use the checkboxes to select the target accounts.
- Open the Bulk Actions dropdown.
- Select Edit Quota.
- Enter the new quota in MB.
- Confirm.
This is useful when onboarding a batch of accounts or when you want to upgrade a group of users to a new plan tier.
Viewing Quota Usage
Admin View
In Admin → Accounts, the Quota column shows both the limit and the current usage side by side:
324 MB / 1024 MB
A progress bar indicates how full the mailbox is. Accounts near capacity are highlighted in orange (>80%) or red (>95%).
Clicking an account opens the detail view, which shows a full breakdown:
- Quota limit
- Current usage (read from Dovecot's quota storage backend or calculated from Maildir size)
- Usage percentage
- Last quota check timestamp
User View
Logged-in webmail users can see their own quota usage at Settings → Account → Storage Usage. The quota bar updates each time the inbox is loaded.
What Happens When a Mailbox Is Full
When a mailbox reaches or exceeds its quota:
- Incoming mail is rejected — Dovecot returns a 452 SMTP error. Postfix generates a bounce notification (NDR) to the sender.
- The user cannot receive new mail until they delete messages and empty the Trash to bring their usage below the limit.
- Sending is not blocked — outgoing mail is not affected by the incoming quota.
- Webmail still works — the user can still log in, read existing messages, and delete items to free space.
Dovecot does not automatically delete messages when a mailbox is full. The user or an admin must delete messages to restore delivery.
Dovecot Quota Backend
Opterius Mail is designed to work with Dovecot's quota=count (or quota=maildir) backend combined with a MySQL passdb/userdb query. The relevant Dovecot configuration snippet looks like:
# /etc/dovecot/conf.d/90-quota.conf
plugin {
quota = count:User quota
quota_rule = *:storage=%{sql:SELECT quota_mb FROM mail_accounts WHERE email='%u'}M
}
This pulls the quota directly from the mail_accounts table using the authenticated user's email address. When you update the quota in Opterius Mail's admin panel, the next delivery attempt by Dovecot picks up the new value automatically.
If you are using the Maildir quota backend instead (quota=maildir), the quota_mb column is still the authoritative value — Dovecot reads the Maildir size and compares it against the database value.
Recommended Quota Strategy for Hosting Providers
| Account Type | Suggested Quota |
|---|---|
| Trial / free tier | 250 MB |
| Basic | 1 GB (1024 MB) |
| Standard | 5 GB (5120 MB) |
| Business | 25 GB (25600 MB) |
| Unlimited plan | 0 (no quota) |
Using 0 (unlimited) should be reserved for accounts where disk space is genuinely unconstrained. For shared hosting environments, always set a reasonable upper bound to prevent a single account from filling the server disk.