Announcement

Collapse
No announcement yet.

How can i disable php mail function?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can i disable php mail function?

    Hello!

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

    Can i do that? How?

    Thanks!

  • #2
    This is the way I do it.
    Its the only method Ive 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:

    Code:
    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 clients 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

    Comment


    • #3
      If it works its perfect for me.

      Thanks!!!

      Comment


      • #4
        how can we do it for DirectAdmin?

        Comment


        • #5
          Originally posted by Kyo View Post
          how can we do it for DirectAdmin?
          I believe the same should work for DirectAdmin as well.
          Just be aware we are talking about the case when a customer is using 'our' PHP Selector only. And user will have a control for this function so can turn back On when needed.

          Comment

          Working...
          X