How can i disable php mail function?
Forum
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. Cristian Beckerle
  2. Tuesday, 07 July 2015
  3.  Subscribe via email
Hello! 

I like to disable the mail() function in php just for one domain/customer. 

Can i do that? How?

Thanks!
Rate this post:
  1. 08.07.2015 03:07:55
  2. # 1
Steve Venter Accepted Answer
Posts: 28
Joined: 24.06.2010
0
Votes
Undo
This is the way I do it.
It's the only method I've been able to figure out, and there might be a much better way to do it, but it works for me.

1. Edit /etc/cl.selector/php.conf

2. 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
3. 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
  1. 08.07.2015 14:07:20
  2. # 2
Cristian Beckerle Accepted Answer
Posts: 6
Joined: 15.10.2014
0
Votes
Undo
If it works its perfect for me. 

Thanks!!!
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.