How to Increase Email Account Disk Quota Using WHM API?

  Uncategorized

Introduction

Email accounts have storage limits (quotas) to control how much mailbox space a user can use. When a mailbox reaches its quota, users may not be able to receive new emails. Using the WHM API, administrators can easily increase the mailbox quota from the command line without logging in to cPanel.

This article explains how to increase an email account’s disk quota using the WHM API.

Prerequisites

Before proceeding, ensure you have:

  • Root access to the WHM/cPanel server.
  • SSH access to the server.
  • An existing cPanel account.
  • An existing email account.
  • WHM API access enabled.

Implementation

Step 1: Connect to the Server

Log in to the server using SSH as the root user.

ssh root@server-ip

Step 2: Increase the Email Quota

Run the following command:

$ whmapi1 uapi_cpanel \
cpanel.user=example \
cpanel.module=Email \
cpanel.function=edit_pop_quota \
email=info@example.com \
quota=5120

Parameter Details

  • cpanel.user – cPanel account username
  • email – Email account name
  • quota – Mailbox quota in MB

Example:

quota=5120

This sets the mailbox quota to 5 GB.

Step 3: Set Unlimited Quota (Optional)

To remove the mailbox size limit:

$ whmapi1 uapi_cpanel \
cpanel.user=example \
cpanel.module=Email \
cpanel.function=edit_pop_quota \
email=info@example.com \
quota=0

A value of 0 means unlimited storage.

Step 4: Verify the Quota

Run:

$ uapi –user=example Email get_pop_quota \
email=info@example.com

You can also list all email accounts and their quotas:

$ uapi –user=example Email list_pops

Conclusion

Using the WHM API, administrators can quickly increase or modify email account quotas without accessing cPanel manually. This method is useful for automation, bulk updates, and managing mailbox storage efficiently. Regularly monitoring mailbox usage helps ensure users can continue sending and receiving emails without interruption.

LEAVE A COMMENT