Divi WordPress Theme

Topic: Disable PHP mail function on cPanel server  (Read 18391 times)

Offline Kevin

  • Junior Guru
  • **
  • Posts: 72
  • iTrader: +4/-0
    • View Profile
Disable PHP mail function on cPanel server
« on: September 28, 2008, 02:49:29 PM »
There is a function available in PHP to send a mail via PHP script. The function is mail(). However, it is advisable to disable PHP mail() function on the shared hosting server to prevent spamming from the server and allow only SMTP authentication to send the emails via PHP script. You can disable PHP mail() function from WHM. You will just need to follow the below steps for that:

[1] Login to your WHM.
[2] Go to Tweak Settings.
[3] Select the option "Prevent the user "nobody" from sending out mail to remote addresses (PHP and CGI scripts generally run as nobody if you are not using PHPSuexec and Suexec respectively.)" and save it.

Regards,

Kevin
VPS Hosting - AccuWebHosting

Offline Kailash

  • Web Hosting Master
  • *****
  • Administrator
  • Posts: 619
  • iTrader: +153/-0
    • View Profile
Re: Disable PHP mail function on cPanel server
« Reply #1 on: April 04, 2013, 10:18:50 AM »
If you are using suPHP, you can add mail function in "disable_functions" in your global php.ini file.

- Kailash

Offline Rick

  • New Member
  • *
  • Posts: 27
  • iTrader: +0/-0
    • View Profile
Re: Disable PHP mail function on cPanel server
« Reply #2 on: April 02, 2014, 12:18:03 PM »
Nowadays most servers are configured to run PHP process under user instead of nobody so tweak settings option doesn't help but cPanel counts the emails which are sent via script so it is better to set appropriate hourly email limit from WHM.

Rick

Offline Kailash

  • Web Hosting Master
  • *****
  • Administrator
  • Posts: 619
  • iTrader: +153/-0
    • View Profile
Re: Disable PHP mail function on cPanel server
« Reply #3 on: July 21, 2014, 12:34:17 PM »
If the server is configured to run PHP process as a user instead of Apache user, you do not need to disable this function. You can set the limit per account as well as you can track the spam originating from the particular account. You will have to make sure that you have configured your Apache+PHP to track headers.
Shopify Divi WordPress Theme
Tags: