How can i disable php mail function on Cloudlinux?

nano /etc/cl.selector/php.conf

Add these lines right at the top of the 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

In the client's cpanel, change the sendmail path to /bin/true using

"Select PHP Version > Switch to PHP Settings"

He will no longer be able to send via php mail

Please rate this article to help us improve our Knowledge Base.

1 0




Hello , talk to a hosting specialist today and discover which options will work best for you.

+255 734 666 100