Enterprise Mail Security & Deliverability

Mailcow SaaS Rate Limits, Disk Quotas & Thin Provision

Configure Mailcow SaaS rate limits, Dovecot disk quotas, safe thin-provisioning ratios, and automated abuse circuit breakers to protect your mail server IP.

Published by SendMeHi Systems • Updated 2026-11-24

When building an email hosting SaaS using Mailcow, your two biggest enemies are spammers ruining your IP reputation and power users exhausting your server's physical disk space. Here is the ultimate guide to configuring Mailcow rate limits, quotas, and SaaS upsell strategies.

1. How do I prevent users from abusing my SMTP server to send spam?

If you give customers SMTP credentials, malicious users will inevitably try to plug those credentials into bulk mailing software to blast thousands of spam emails. To prevent this, you must set strict Outbound Rate Limits.

In Mailcow, you can enforce a hard stop (e.g., 100 emails per hour). A normal business user replying to emails will never hit this limit, but a spammer will hit it in 3 minutes, triggering an automatic block.

How to set a Global Default Rate Limit in Mailcow:

  1. Log in to your Mailcow Admin Panel.
  2. Click on E-Mail ➔ Configuration in the top right menu.
  3. Click on the Defaults tab.
  4. Find the Rate limit setting and set it to 100 msgs / hour.
  5. Save your changes. This applies the limit to all future domains automatically.

2. Max Mailboxes vs. Max Aliases: What is the best SaaS strategy?

When defining your default hosting templates, it's crucial to understand the difference in server cost between an inbox and an alias.

  • Mailboxes (Keep the limit low): A mailbox is a physical inbox with a password. It consumes disk space. Giants like Google Workspace charge $6–$14/month per mailbox. Set your default plan to allow only 3 to 5 mailboxes. When a company hires their 6th employee, they hit the limit, creating a natural upgrade opportunity.
  • Aliases (Keep the limit high): An alias (like billing@ forwarding to ceo@) is just a routing rule. It has no password and uses zero disk space. Set this limit high (e.g., 400). It makes your platform look incredibly generous without costing you a single cent in server resources.

3. If I have a 100GB server and sell 300GB of quotas, what happens?

Mailcow uses dynamic allocation (thin provisioning). When you create a mailbox and give it a 3 GB limit, the server does not instantly block out 3 GB on the hard drive. A brand-new inbox only uses a few kilobytes.

Space is only consumed when physical emails arrive. This means you can safely oversell your server space. You can host 100 users with a 3 GB limit each (300 GB total promised) on a 100 GB server, because in reality, most users only use 50MB to 200MB.

⚠️ The Danger of Overselling

If your physical hard drive ever hits 100% full, your server will crash and all incoming emails will bounce. Always set a server alert to notify you when your physical disk hits 80% capacity so you can upgrade the drive before disaster strikes.

4. How should I handle users who hit their mailbox limit?

Never show a dead-end error! If a user tries to create an 11th mailbox and the Mailcow API rejects it because the quota is reached, your frontend UI should intercept that error.

Instead of a red error text, render a beautiful "Contact Support to Upgrade" button. By using a smart mailto: link, you can pre-fill the subject line and body text (e.g., "Upgrade Request: Increase Mailbox Limit for mydomain.com"), turning a frustrating limitation into a seamless sales funnel.

Engineering Tiered Outbound Rate Limits in Mailcow & Rspamd

Relying on a single flat rate limit across every tenant leaves two blind spots: high-trust enterprise clients hit artificial ceilings during quarterly billing runs, while newly signed-up trial accounts with stolen credit cards can still blast 100 spam messages in three minutes before triggering a freeze. Production multi-tenant Mailcow SaaS architectures implement tiered per-mailbox AND per-domain Rspamd buckets.

Tenant Trust Tier Per-Mailbox Limit Per-Domain Aggregate Cap Max Recipients / Message Abuse Enforcement Action
14-Day Free Trial / Unverified 15 msgs / hour 40 msgs / hour 10 recipients Immediate soft-reject + Slack/Webhook alert
Starter (Paid & Verified DNS) 60 msgs / hour 250 msgs / hour 35 recipients Queue hold + admin review flag
Professional (30+ Days Clean) 150 msgs / hour 600 msgs / hour 50 recipients Auto-throttle burst + owner notification
Enterprise (Dedicated Relay / IP) 500 msgs / hour Custom / External Relay 100 recipients Dedicated Maileroo/SES relay routing

Applying Per-Domain & Per-Mailbox Limits via the Mailcow REST API

When provisioning SaaS customers programmatically (the exact pattern used by SendMeHi), set the domain and mailbox rate limits inside the same onboarding API transaction using Mailcow's /api/v1/edit/rl-domain and /api/v1/edit/rl-mbox endpoints:

# Apply strict 60 messages/hour rate limit to a newly provisioned mailbox
curl -X POST "https://mail.yourplatform.com/api/v1/edit/rl-mbox" \
  -H "X-API-Key: $MAILCOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "attr": { "rl_frame": "h", "rl_value": "60" },
    "items": ["sales@customerdomain.com"]
  }'

Pair Rspamd rate limits with Postfix anvil connection limits inside data/conf/postfix/extra.cf (such as smtpd_client_message_rate_limit = 60 and smtpd_recipient_limit = 50) so a runaway credential-stuffing script cannot flood your Postfix active queue before Rspamd inspects the payload.

Thin Provisioning & Overselling Calculus: Safe vs. Dangerous Ratios

Because Dovecot stores messages in Maildir format (often paired with Mailcow's built-in zlib / zstd Dovecot compression plugin that shrinks plaintext emails and uncompressed attachments by 35% to 55%), real-world SMB storage utilization follows a predictable power-law curve:

  • 70% of SMB mailboxes stay below 450 MB after their first year of active use.
  • 20% of mailboxes (account managers, recruiters, customer support) occupy 1 GB to 4 GB.
  • 10% of power users (founders, design directors, legal counsel) consume 5 GB to 25 GB—accounting for over 60% of your entire physical disk volume.

The Safe Multi-Tenant Overselling Formula: On a 200 GB NVMe VPS (reserving 40 GB for Ubuntu OS, Docker images, MariaDB/Redis, Rspamd Bayes databases, and ClamAV definitions), you have 160 GB of usable Maildir space. With a conservative 3:1 to 4:1 thin-provisioning ratio, you can safely allocate 480 GB to 640 GB of nominal customer mailbox quotas while maintaining actual physical utilization below 55%. Never push past a 6:1 ratio unless you have automated NVMe volume expansion (such as Hetzner Cloud Volumes or ZFS pools) wired to 75% disk-usage webhooks.

Monitoring Real Disk Consumption & Dovecot Quota Health

Run automated daily telemetry checks against Dovecot inside the Mailcow container to catch runaway attachment hoarders or malfunctioning IMAP backup loops before physical storage climbs past 75%:

# Inspect top storage-consuming mailboxes across all Mailcow tenants
docker compose exec dovecot-mailcow doveadm quota get -A | sort -k4 -rn | head -n 25

# Recalculate drifted quota counts after large IMAP migrations or bulk purges
docker compose exec dovecot-mailcow doveadm quota recalc -A

# Check physical Docker volume utilization on host
df -h /var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data

Automating 80% / 95% Quota Warnings & Zero-Friction SaaS Upgrades

When an active business mailbox hits 100% of its Dovecot quota, Postfix rejects new inbound mail with 452 4.2.2 Over quota (deferring temporarily before bouncing permanently). Nothing angers a paying SaaS customer faster than losing a client contract because their inbox filled up silently. Build a three-stage automated quota pipeline:

  1. 80% Soft Warning Trigger: Configure Dovecot's quota_warning plugin to deliver a friendly system notification inside the inbox AND fire a webhook to your SaaS backend showing an unobtrusive upgrade banner in the webmail header.
  2. 95% Critical Warning + One-Click Capacity Boost: Trigger an email + dashboard alert to the organization administrator with a direct Stripe/PayPal upgrade CTA (moving from Starter 1 GB/user to Professional 5 GB/user or Enterprise storage) that calls Mailcow's /api/v1/edit/mailbox endpoint instantaneously upon checkout confirmation.
  3. Automated Trash & Junk Pruning Policies: Configure Dovecot autoexpunge rules (e.g., auto-expunging Junk after 30 days and Trash after 30 days) so forgotten spam folders never consume billable NVMe space.

Protecting Shared IP Reputation Across Multi-Tenant SaaS Customers

Even with strict hourly rate limits, one compromised customer password can damage a multi-tenant server's outbound IP reputation if left unmonitored. Pair rate limits with four proactive Mailcow SaaS safeguards:

  • Mandatory Outbound Rspamd Spam Scanning: Unlike default setups that skip spam filtering on authenticated senders, inspect authenticated outbound mail for high-confidence phishing URLs, bulk spam templates, and credential-harvesting patterns—automatically holding messages scoring above 12.0 for admin review.
  • Automated Queue Spike Watchdog: Run a 60-second cron script inspecting mailq | tail -n 1. If deferred messages exceed 150 or a single sender accounts for >40% of active queue entries, trigger an immediate Telegram/Slack alert and pause the offending mailbox via API.
  • Bounce-Ratio Circuit Breakers: Spammers using scraped lists generate 15%–40% SMTP 550 User Unknown hard bounces immediately. Parse Postfix logs continuously; suspend any new tenant whose outbound hard-bounce ratio exceeds 8% over 50 messages.
  • Dedicated Bulk Relay Offloading: Educate customers clearly that corporate Mailcow seats are engineered for human business mail, and route promotional broadcasts through an isolated transactional/marketing relay (see our VPS bulk email IP reputation analysis and Maileroo + Mailcow coexistence guide).

Rspamd Redis Bucket Architecture & Custom Lua Rate-Limit Guardrails

Under the hood, Mailcow's rate-limiting engine runs inside Rspamd's ratelimit module backed by in-memory Redis leaky buckets. Unlike crude Postfix connection counters that only measure raw TCP sessions, Rspamd tracks authenticated SASL usernames, envelope sender domains, and recipient fan-out dynamically—allowing legitimate bursts (such as replying to a 12-person project thread) while hard-capping sustained automated loops. Store custom multi-tier overrides in data/conf/rspamd/local.d/ratelimit.conf so Mailcow container updates never overwrite your SaaS abuse rules, and forward Redis rate-limit trip events straight to your operations alerting channel for rapid account triage.

Backup Architecture & Disaster Recovery for Multi-Tenant Mailcow Servers

Thin provisioning and tight rate limits protect uptime during normal growth, yet multi-tenant email operators must equally plan for catastrophic disk corruption, accidental customer folder deletion, or sudden VPS host failure. Mailcow ships with an official helper-scripts/backup_and_restore.sh utility capable of cold-consistent snapshots across MariaDB, Redis, Dovecot vmail Maildirs, Postfix configs, and DKIM private keys.

However, storing backups on the exact same physical VPS drive offers zero protection against node loss or ransomware. Production SaaS operators combine three resilient backup layers:

  1. Incremental Deduplicated Off-Site Snapshots (Restic or BorgBackup to Cloudflare R2 / Backblaze B2): Because email attachments and thread replies repeat heavily across team mailboxes, running nightly Restic snapshots of /var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data directly to zero-egress Cloudflare R2 storage typically achieves 50%–70% deduplication compression while maintaining 30-day point-in-time recovery at pennies per gigabyte.
  2. Hourly MariaDB & DKIM Key Dumps: Export the lightweight Mailcow SQL schema (domain tables, alias mappings, hashed mailbox passwords, and DKIM RSA private keys) every hour to encrypted remote object storage. Losing customer email history is bad; losing DKIM private keys and domain routing tables forces every single tenant to reconfigure DNS across hundreds of zones.
  3. Tested Single-Mailbox Granular Restoration: Practice restoring a single deleted user's cur/ and new/ Maildir subdirectories via doveadm import into a recovery subfolder (Restored-Backup) followed by doveadm force-resync and doveadm quota recalc. Documenting and timing this exact 5-minute workflow turns frantic client support escalations into effortless enterprise service-level wins.

Capacity Scaling Thresholds: When to Shard onto a Second Mailcow Node

A single well-tuned 8-vCPU / 16 GB RAM NVMe Mailcow instance comfortably sustains 800 to 1,500 active SMB mailboxes depending on IMAP client concurrency and ClamAV scanning overhead. Plan your horizontal shard to a second Mailcow cluster (e.g., mx2.yourplatform.com) well before hitting emergency limits—specifically whenever sustained 5-minute load averages exceed 70% of physical cores, Dovecot IMAP login processes regularly peak above 800 concurrent connections, physical Maildir utilization passes 65% of NVMe volume capacity, or your aggregate daily outbound volume makes IP blast-radius isolation across customer cohorts commercially prudent.

Frequently Asked Questions

What is the safest default outbound rate limit for a multi-tenant Mailcow SaaS?

Start newly provisioned trial accounts at 15–20 messages per hour per mailbox and paid verified domains at 60–100 messages per hour per mailbox (capped around 250–500 per domain). Normal human business correspondence rarely exceeds 25 messages per hour, while compromised accounts or spammers trigger the block within minutes before blacklisting your IP.

What overselling ratio is safe when thin-provisioning Mailcow disk quotas?

A 3:1 to 4:1 thin-provisioning ratio is generally safe on NVMe storage when combined with Dovecot zlib/zstd compression, 30-day Junk/Trash auto-expunge rules, and automated host alerts at 75% physical disk usage. Avoid exceeding 5:1 without automated block-volume expansion.

Does creating 400 email aliases consume extra disk space or RAM in Mailcow?

No. Email aliases are tiny SQL routing rows inside MariaDB that forward incoming messages to existing destination mailboxes. Offering generous or unlimited aliases adds virtually zero storage or memory overhead while dramatically increasing perceived value for SaaS customers.

How does Mailcow handle a mailbox that hits 100% of its storage quota?

Once a mailbox reaches 100% quota utilization, Dovecot LMTP rejects further incoming deliveries with a temporary 452 Over Quota error (or permanent 552 rejection depending on configuration). Always configure 80% and 95% Dovecot quota warnings paired with one-click upgrade prompts so customers never miss inbound mail.

How much RAM and CPU does a production Mailcow server need for 500 mailboxes?

For 500 active SMB mailboxes with ClamAV, Rspamd, Solr/FTS, SOGo, and Redis running smoothly, provision at least 4 vCPUs and 8 GB to 16 GB of RAM on fast NVMe storage (such as Hetzner CX32/CPX31 or higher), plus a 4 GB swap guard to prevent OOM kills during ClamAV signature reloads.

Can I change a tenant's Mailcow rate limit or disk quota dynamically via API?

Yes. Mailcow exposes full REST API endpoints (/api/v1/edit/rl-mbox, /api/v1/edit/rl-domain, and /api/v1/edit/mailbox) allowing your Stripe or PayPal billing webhooks to instantly upgrade storage quotas, mailbox counts, and hourly sending limits the second a customer upgrades their plan.

How do I stop spammers from signing up for free trials on my email SaaS?

Require DNS domain ownership verification before unlocking outbound SMTP, restrict trial sending to 15 messages/hour, enforce outbound Rspamd spam inspection, require a valid payment method or phone/domain age check for higher limits, and monitor Postfix bounce ratios in real time.

Related Engineering Guides