Skip to content

Bulk-create email accounts and set a default mailbox quota in cPanel

How to create many email accounts at once for a domain, set a sensible default mailbox quota, and avoid the disk and delivery problems that come from quotas set too high or too low.

Standing up a new domain often means creating a row of mailboxes at once — info@, sales@, support@, plus one per staff member — and giving each a sensible storage quota so no single mailbox can fill the account’s disk. Doing this one account at a time in the cPanel UI is slow and error-prone; cPanel and WHM provide faster paths, and the more important decision is the default quota you assign, because a quota set too high lets one mailbox starve the others while one set too low bounces inbound mail. This runbook covers creating accounts in bulk and choosing a default quota that protects the account without surprising users.

What’s happening

Each email account on a cPanel domain is a mailbox with its own quota — a cap on how much mail it can store — carved out of the cPanel account’s overall disk. The sum of all mailbox quotas, plus the website and everything else, lives on the account’s disk allotment. If every mailbox is set to Unlimited, one user who never empties their inbox can consume the entire account’s disk, at which point every service on the account — other mailboxes, the website, databases — starts failing because the disk is full. Conversely, a quota set too small means the mailbox hits its limit and inbound mail bounces with 552/over quota while the user is still actively using it.

The right default is a finite per-mailbox quota sized so the realistic number of mailboxes fits comfortably within the account’s disk with headroom. For bulk creation, cPanel offers the Email Accounts interface (create one at a time, but quickly) and, for many accounts, a scripted approach via the API or WHM. The default quota you choose at creation applies to each new mailbox and can be overridden per account later. Getting the default right at provisioning time means you rarely have to revisit it, and the account’s disk stays predictable rather than hostage to whichever user hoards the most mail.

How to verify

Check the account’s disk allotment and how much mail already exists.

# Account disk quota and current usage
quota -u <cpaneluser>
du -sh /home/<cpaneluser>/mail/ 2>/dev/null

# Existing mailboxes and their quotas for the domain
ls /home/<cpaneluser>/mail/example.com/ 2>/dev/null
for d in /home/<cpaneluser>/mail/example.com/*/; do \
  echo -n "$d "; cat "$d/maildirsize" 2>/dev/null | head -1; done

After bulk creation, confirm the accounts exist with the intended quota:

# List email accounts and quotas via the API
whmapi1 list_pops_for domain=example.com 2>/dev/null
uapi --user=<cpaneluser> Email list_pops 2>/dev/null | grep -iE 'email|_diskquota|_diskused'

Confirm the sum of quotas does not overcommit the account disk:

# Total disk available vs sum of mailbox quotas (sanity check)
df -h /home
du -sh /home/<cpaneluser>/ 2>/dev/null

The fix

  1. Decide the default quota before creating anything — size it so (number of mailboxes × default quota) fits within the account’s disk with room for the website and growth. A finite default (not Unlimited) is the key protection; pick a per-mailbox figure that matches how the users actually work.

  2. Create the standard role addresses first — in cPanel » Email Accounts » Create, add the role mailboxes (info, sales, support) and the per-person addresses, setting the chosen quota on each. The Create form lets you set the storage space per account at creation, so apply the default consistently.

  3. Script bulk creation for many accounts — for a long list, use the cPanel UAPI/WHM API to create accounts from a file rather than clicking through the UI, applying the same quota to each:

    while IFS=, read -r addr pass; do \
      uapi --user=<cpaneluser> Email add_pop email="$addr" password="$pass" \
        quota=2048 domain=example.com; \
    done < newmailboxes.csv
  4. Avoid Unlimited quotas on shared accounts — set Unlimited only for a mailbox you specifically intend to let grow without bound, and only when the account disk can absorb it. On a normal account, one Unlimited mailbox defeats the purpose of quotas for everyone else.

  5. Leave headroom on the account disk — do not allocate quotas that sum to the full account disk; the website, databases, logs, and mail overhead all need space. Allocate so the total of all quotas plus non-mail usage stays comfortably under the disk limit, or a quota that is individually fine still fails when the disk fills.

  6. Set a default quota for future mailboxes — where the interface supports a per-domain default, set it so accounts created later inherit the sensible figure automatically and nobody accidentally provisions an Unlimited mailbox.

  7. Tell users how to check and manage their usage — a quota only causes a support ticket if it surprises someone. Point users at Webmail » Settings (their usage) and the practice of emptying Trash/Junk, so an approaching limit is handled before it bounces inbound mail.

Once the accounts exist with a consistent, finite quota that fits the account disk, the domain’s mail provisioning is predictable: no single mailbox can starve the others, and inbound mail does not bounce unexpectedly. The decision that matters is the default quota — set it deliberately at creation and the account stays healthy with little ongoing attention. Stack Harbor provisions and sizes cPanel mailboxes under cPanel server administration — start a conversation.