How to disable the php mail() function on cPanel with CloudLinux?

If your server installed cPanel with CloudLinux along alt-php and you want to disable php mail() function for one domain, then you can do this using the following steps :

1. Logged into your server via SSH and Edit /etc/cl.selector/php.conf file.

2. Add below lines at the top of this file:

Directive = sendmail_path
Default = /usr/sbin/sendmail -t -i
Type = list
Range = /usr/sbin/sendmail -t -i,/bin/true
Comment = Switch to /bin/true to disable php mail

3. Then, logged into client's cpanel, change the sendmail path to /bin/true using "Select PHP Version > Switch to PHP Settings".

The account will no longer be able to send via php mail.

Enjoy and let me know your thoughts on this article.

Was this answer helpful?

 Print this Article

Also Read

How to renew the cPanel license on your server?

Quickest way to renew cPanel license - First, you may check if the server has valid license for...

How to allow remote MySql connection to only one IP?

There may be a case in which one of the cPanel user request you to provide access to Mysql...

JFolder::create: Could not create directory - Warning! Failed to move file. Unable to find install package - Joomla Issue

While installing Extension in Joomla I was getting below error message - JFolder::create: Could...

How to install mod_pagespeed on WHM?

'mod_pagespeed' is module of Apache which is nothing but plugin which is used for compressing the...

Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.

I was getting below error while accessing phpMyAdmin - Cannot start session without errors,...

Powered by WHMCompleteSolution