Dovecot Catch-All Mistakes: Quota, Namespace, and Shared Mail
A catch-all email address looks like the simplest thing in the world to set up. You add one line to the Postfix virtual alias map or tick a box in the Dovecot user database, and suddenly every message sent to a misspelled or invented address at your domain lands in one mailbox. That is the whole promise of the catch-all mailbox: no lost mail, no bouncing invoices, no angry customers who typed support@ instead of sales@.
Then the mailbox fills up. Six months later the disk is full, a legitimate invoice bounced with a quota error, and the catch-all account has 40 GB of dictionary spam in it. The server did exactly what it was told. The mistakes were made earlier, in the Dovecot configuration and in the decisions around it. This article walks through the four that cause the most damage: reusing a real person’s mailbox as the catch-all, leaving the account without a quota, skipping a dedicated namespace for shared mail, and ignoring spam filtering and recipient validation entirely.
These problems share a root cause. A catch-all mailbox accepts traffic that no human chose to receive, and Dovecot was designed around the assumption that each mailbox belongs to someone who reads it. Quota enforcement, namespace isolation, and shared folder permissions all behave differently once a single account is absorbing mail for every unknown recipient at a domain. Get the details right and the catch-all stays a useful safety net. Get them wrong and it becomes the thing that takes your mail server down on a Saturday. The sections below cover each mistake in turn, with the configuration choices that avoid it and the trade-offs you accept when you enable one.
Catch-All Email Meaning and Why Dovecot Admins Enable It
A catch-all email is a mail server rule that accepts every message sent to a domain, no matter what name appears before the @ sign. Someone writes to invoices@example.com, office@example.com, or a misspelled jhon.smith@example.com, and all three land in the same Dovecot mailbox. The catch-all email address is not a DNS record and not a special alias. It is a configuration on the mail server that tells Dovecot what to do when no real account matches the recipient.
The mechanics are simple once you separate the layers. MX records route inbound mail to a mail server; that part is pure email routing DNS and has nothing to do with catch-all behavior. The server then looks up the local part of the address. A standard mail server replies with 550 no such user when no mailbox matches. With a catch-all enabled, that rejection never happens: unknown recipient acceptance kicks in and the message is delivered to the designated account. In a virtual-user setup this is usually a wildcard mailbox entry, a row like @example.com pointing at a local user, or an explicit catch-all setting in the Dovecot configuration or the MTA that feeds it.
Admins turn this on for practical reasons more often than for elegance. A small company wants to receive mail sent to sales@, info@, support@ and every other address printed on an old business card without maintaining dozens of aliases. A developer wants a catch-all domain for automation and sign-ups, where each service gets a unique, unpredictable address and everything funnels into one readable mailbox. A migration in progress needs a safety net so mail to accounts that were not yet created does not bounce into the void.
What a Catch-All Is Not
The term gets stretched, so it helps to pin down the boundaries before touching Dovecot. Catch-all differs from alias, forwarding and disposable addresses, and mixing them up leads directly to the configuration mistakes covered in the rest of this guide.
- Alias: one fixed local part mapped to another mailbox. It catches exactly the names you listed, nothing else.
- Forwarding: a message is relayed to an external address. The local server is a relay, not the final destination.
- Disposable address: a temporary or service-specific name, often on a catch-all domain, that can be revoked later.
- Catch-all: a fallback rule mail server side that accepts every unmatched local part for the domain.
One more distinction matters for later sections: SPF, DKIM and DMARC govern outbound mail only. They have no say in whether an inbound message to an invented address is accepted. That decision belongs entirely to the mail server, which is why a working catch-all setup requires DNS pointing at the right host and a server that accepts unknown recipients, and why a broken catch-all is almost never a DNS problem.
Mistake One: Pointing the Catch-All at a Real User’s Mailbox
The first setup most admins try is also the one they regret. There is already a working mailbox, say office@example.com, and the fast fix is to make it the catch-all address. One line in Postfix’s virtual alias map or a Dovecot catch-all user later, every message sent to a domain that does not match a real account lands in a human being’s inbox. It takes minutes to configure and weeks to untangle.
Picture what that inbox looks like after a month. A catch-all domain is a magnet for dictionary spam: bots guess names like info, sales, accounts, j.smith, and the mail server has no reason to refuse any of them because the catch-all accepts every message sent to the domain. The person who owns office@example.com now scrolls past hundreds of invented recipients to find the invoice from a real supplier. Search stops being reliable, filters become guesswork, and eventually the human starts ignoring the account entirely.
The damage goes beyond clutter. When a real user’s mailbox doubles as the catch-all mailbox, the two traffic streams share one quota. A spam flood aimed at random addresses can push the account over its limit, and Dovecot will then refuse delivery for legitimate mail to the same user. The bounce that follows is a genuine business message rejected because a bot guessed noreply2@example.com. There is no clean way to separate the two workloads after the fact, because both arrive as ordinary messages in the same INBOX.
The fix is structural, not cosmetic. Create a dedicated catch-all account with its own name, its own home directory, and its own quota, for example catchall@example.com. Point the domain’s unknown-recipient rule at that account and leave every human mailbox out of it. In Dovecot terms that means a separate user entry in the passwd-file or SQL userdb, not a wildcard appended to an existing user. In Postfix, a virtual alias of the form @example.com catchall@example.com keeps the routing explicit and readable.
Once the streams are split, several things get easier at once. The catch-all can be filtered aggressively without touching real correspondence, its growth can be measured on its own, and a legitimate sender who mistypes an address still gets a human reply from whoever monitors the shared account. The dedicated account also makes auditing honest: if the catch-all fills up, you know it is unknown-recipient traffic and not someone’s customer thread.
One caveat before moving on. A catch-all email is configured on the mail server, not in DNS, so changing the account means editing the MTA and the Dovecot user database together. If MX records route inbound mail to a host you do not control, confirm where unknown recipients are actually being accepted before you promise anyone a clean migration.
Mistake Two: No Quota on the Catch-All Mailbox
The first catch-all mailbox I ever set up on Dovecot had no quota. It was a small domain, maybe forty real users, and the admin before me had pointed @example.com at a single account called junk. Six months later the partition holding /var/mail was full, Postfix was deferring every message in the queue, and the culprit was 61 GB of mail in one Maildir. Nobody had noticed because no monitoring watched that mailbox, and Dovecot had no reason to complain: without a quota plugin configured, it will happily write until the filesystem says stop.
How to set a quota that actually holds
Dovecot quota is per-user by default, which is exactly what you want for a catch-all. In 10-mail.conf make sure the quota plugin is in the mail_plugins list and that the quota dictionary is defined, then set limits in the userdb or in a passwd-file entry for the catch-all account specifically:
- In 90-quota.conf, set quota_rule = *:storage=5G as the default, then override the catch-all user with something tighter, for example quota_rule = *:storage=2G:messages=100000.
- Keep quota_grace small. The default 10 percent is fine for humans; for a catch-all it just delays the inevitable by a few hundred megabytes.
- Decide what happens at the limit. The default quota plugin refuses new deliveries with a temporary failure, which makes the sending MTA retry and pile up a queue. For a catch-all you usually want quota_exceeded to reject rather than defer, so the sending server gets a clean 5xx and gives up.
Watch the interaction between per-user quota and disk. A 2 GB quota on the catch-all does not protect the filesystem if you have 300 other users each with a 10 GB allowance on a 1 TB volume. Budget the catch-all as a separate line item and alert on it separately.
The subtler failure is the shared mailbox. If the catch-all is a Dovecot account that several people also read, whether through a shared namespace or a plain IMAP login, the quota is a single bucket. Spam delivered to invented addresses counts against the same limit as the invoice a colleague is waiting for. Once the bucket fills, Dovecot rejects the legitimate message too, and the sender sees a bounce that mentions nothing about a catch-all. Give the catch-all its own account, its own quota, and its own alert threshold, and let real mail live somewhere that unknown-recipient traffic cannot reach.
Mistake Three: Skipping a Dedicated Namespace for Shared Mail
A namespace mistake does not announce itself. Dovecot will happily deliver catch-all mail into the default namespace of a real user, and everything looks fine until you inspect the folder list. catch-all in email verification offers additional context worth reviewing. The inbox then holds a mixture of genuine correspondence and mail addressed to addresses that were never provisioned, and the two are indistinguishable once they land in the same place.
Dovecot namespaces exist to separate mailboxes by purpose. The default namespace serves the user’s personal mail. A second namespace gives shared or catch-all traffic its own root, its own separator, and its own prefix, so a folder listing can tell the two apart at a glance. Without it, there is no structural boundary. A catch-all account receiving thousands of messages a day to invented addresses looks exactly like a busy support account, and the operator has no way to answer the simple question of how much of that inbox is real.
Namespace syntax and a separation strategy
A dedicated namespace in dovecot.conf looks roughly like this:
The prefix matters. With CatchAll/ in front, every mailbox the catch-all rule writes to sits under a visible root that is distinct from the user’s own inbox. The inbox = no line prevents Dovecot from treating this namespace as the primary inbox, which keeps the account’s real mail and the unknown-recipient stream from colliding. The location should point at a directory tree you can measure, back up, and purge independently of the personal mailbox.
The strategy behind the syntax is simpler than the syntax itself. Give the catch-all its own account, its own namespace, and its own storage path. Then a quota applied to that namespace limits only the unknown-recipient mail. If the catch-all shares a user with real correspondence and shares a quota with it, a spam wave fills the quota and the next legitimate message gets rejected at delivery, usually with a temporary failure the sender sees as a bounce. Separating the namespace means the spam can hit its own ceiling while real mail keeps flowing.
One more detail: set hidden = no and list = yes only if you intend to browse the catch-all tree. If the namespace is purely a dumping ground, hiding it from the user’s folder list reduces confusion and keeps clients from trying to sync a mailbox that grows without limit.
Mistake Four: Ignoring Spam Filtering and Recipient Validation
A catch-all domain changes the economics of spam. A normal mailbox only accepts mail for one address, so a dictionary attack that fires 50,000 guesses at a domain produces one delivery and 49,999 rejections. Turn on a catch-all and every guess becomes a delivery. Attackers know this. They run address-guessing tools against domains and sell the confirmed hits, and a catch-all hands them confirmation for free because your server returns 250 for names that never existed. The result lands in the catch-all mailbox, and since that mailbox usually has no real owner watching it, the junk accumulates until Dovecot’s disk fills or the quota trips.
Backscatter adds a second stream. When a spam run forges your domain in the envelope sender, bounces and challenge messages arrive at addresses like postmaster, abuse, or random strings. A server that replies 550 no such user to those recipients stops the conversation at SMTP time. A catch-all accepts them all, so the mailbox absorbs traffic you never wanted and never asked for.
The fix is layered. First, reject clearly invalid recipients before they reach Dovecot. Postfix’s reject_unlisted_recipient and a recipient validation map catch typos and non-existent local parts at RCPT TO, before any DATA is transferred. If you run the catch-all in Postfix with a virtual alias domain, keep the validation map separate from the catch-all rule so you can reject obvious garbage without disabling the fallback. Second, filter before delivery. A milter or content filter that scores messages on the way in keeps spam out of the mailbox entirely instead of letting Dovecot store it and clean up later. Third, set a rule in Dovecot itself. A sieve script on the catch-all account can file messages by sender reputation or subject pattern, but that is damage control, not prevention.
| Approach | Where it runs | Effect on catch-all traffic | Trade-off |
|---|---|---|---|
| Reject unlisted recipients at SMTP | Postfix, RCPT TO stage | Refuses unknown local parts with 550 no such user | Defeats the purpose if applied to the catch-all domain itself |
| Recipient validation map | Postfix lookup table | Blocks typos and guessed names before DATA | Requires maintenance as real addresses change |
| Content filter or milter | Pre-queue or pre-delivery | Scores and quarantines spam before Dovecot stores it | CPU cost and tuning effort per domain |
| Sieve rules on the catch-all account | Dovecot LDA/LMTP | Files or discards messages after delivery | Mail is already stored, so quota still counts it |
| Rate limiting and greylisting | Postfix policy service | Slows dictionary runs and repeated guesses | Adds delivery delay for legitimate senders |
One practical check: watch the catch-all mailbox’s message count per day. A quiet domain that suddenly receives hundreds of messages to random names is being enumerated. Tightening recipient checks at that point costs nothing and saves the quota. AllMail.one publishes a guide to catch-all email that covers these trade-offs in more detail, including when a catch-all is worth the spam load and when a forwarding rule is the better answer.
Monitoring and Maintenance for a Healthy Catch-All Setup
A catch-all mailbox does not fail loudly. It fills quietly, week after week, and the first symptom most admins see is a bounce notice for a real customer whose message hit a full disk. Dovecot gives you the counters and hooks to catch that drift early, but only if someone reads them. Treat monitoring as part of the catch-all setup, not an afterthought.
Start with quota reporting. Run doveadm quota get -A on a schedule and watch the percentage for the catch-all user. A healthy catch-all that receives mostly sign-up confirmations and misaddressed mail should sit in a predictable band. When the number climbs 5 to 10 points month over month with no change in business volume, something is feeding it that you did not plan for. If you use the Dovecot quota plugin, set the quota warning threshold at 80 percent and point the warning at an address a human actually reads, not at the catch-all itself, or the alert lands in the mailbox that is full.
Mailbox size alerts belong at the filesystem level too. A catch-all with a 5 GB quota on a volume with 20 GB free is a slow-motion outage. Watch the maildir size with a simple cron check and page when free space drops below a set floor. Pair it with a weekly count of messages in the catch-all folder: a jump from 300 to 3,000 in seven days means a dictionary attack or a scraped address list is hammering the domain, and the fix is at SMTP time, not in the mailbox.
Periodic audits keep the account honest. Once a quarter, review what actually arrives. Sort by sender domain, count the top twenty, and look for patterns: repetitive invented local parts, foreign-language spam, backscatter from forged return paths. Check whether any legitimate service has started using the catch-all as its primary contact, because that address now carries real traffic and deserves a named mailbox. Confirm the account still has a quota, still lives in its own namespace if you run shared mail, and still has recipient validation in front of it.
Logging closes the loop. Dovecot writes delivery and rejection events, and the MTA logs every 550 no such user it returns. Grep those weekly. A rising count of rejections is good news if you added validation, and a warning sign if you did not. AllMail.one publishes a guide to catch-all email that covers the same checks from the mail server side, useful when you want a second opinion on thresholds.
Set the checks, assign an owner, and put the review on a calendar. A catch-all email address earns its keep only while someone is watching the numbers behind it.
Before you enable a catch-all, run through the whole chain once on paper. Check that your MX records point at the host actually running Dovecot, confirm the postfix or Dovecot lookup returns the intended account for an address that does not exist, and verify the server accepts unknown recipients instead of answering with 550 no such user. Then set a mailbox quota in the tens of megabytes rather than gigabytes, create a separate namespace for the shared catch-all so it does not sit inside a human user’s folder tree, and make sure your spam filter runs before delivery. A working catch-all setup needs all four pieces: DNS pointing at the right host, a server accepting unknown recipients, a quota that caps the damage, and a filter that keeps the volume down. Skip any one of them and the account turns into a disk-filling, bounce-generating liability within weeks.
A practical next step: pick one low-risk domain, add a dedicated catch-all user with a 500 MB quota and its own namespace, then watch it for 30 days. Log how many messages arrive, how many are spam, and how fast the mailbox grows. If the spam ratio is above 90 percent, tighten recipient validation at SMTP time or drop the catch-all entirely and go back to explicit aliases. If the volume is manageable, document the setup, add a quota-warning cron job, and review the mailbox size monthly. AllMail.one publishes a guide to catch-all email that walks through DNS, server-side acceptance, and filtering in the same order, which makes a useful checklist for that first test domain. Treat the catch-all as a monitored service, not a set-and-forget address, and it will do the job you set it up for.
