As we know that cPanel/WHM provide the privilege to suspend a user account when we need to interrupt any cPanel user accounts service due to various reasons like Payment, malfunction, and other reasons. Even the cPanel enables the user to suspend/unsuspend mail accounts in order to hold the respective mail ids incoming and outgoing mail functions. This can be done through the “Email Accounts” option in cPanel. Though cPanel/WHM allows suspending an entire cPanel account and particular mail account of a user, we can not suspend an inbound and outbound of mail function of a specified user through cPanel/WHM GUI (Graphical User Interface). But we can suspend an incoming and outgoing mail function of a specified cPanel user account through command line or WHM API functions.

In some scenarios Websites developed using CMS like WordPress or framework based sites would be compromised and sending spam mails from your server. In such cases suspending particular mail accounts won’t help, so we need to hold the inbound or outbound mail function of cPanel.

Suspend Outgoing mail functions:

Command to suspend outbound mail functions,

whmapi1 suspend_outgoing_email user=demo

Suspend outbound mail function through WHM XML API shell,

https://hostname.example.com:2087/cpsess##########/xml-api/suspend_outgoing_email?api.version=1&user=demo

UnSuspend Outgoing mail functions:

Command to suspend outbound mail functions,

whmapi1 unsuspend_outgoing_email user=demo

Suspend outbound mail function through WHM XML API shell,

https://hostname.example.com:2087/cpsess##########/xml-api/unsuspend_outgoing_email?api.version=1&user=demo

You should have the root access of your server to run the above commands and API.