1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Disable function mail()

Discussion in 'Plesk 11.x for Linux' started by ErwanG, Aug 27, 2012.

  1. ErwanG

    ErwanG Regular Pleskian

    20
    57%
    Joined:
    Apr 29, 2010
    Messages:
    121
    Likes Received:
    0
    Hello,

    I want to disable mail fonction for one of my customer.
    I've put "disabled_functions = mail" in the php.ini from the customer in the panel and i've reload Apache.

    It doesn't work.

    Thanks for your help.

    Config :
    Plesk 11.0.9 - PHP 5.3
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    disabled_functions is part of safe mode. Make sure that you have enabled this mode.
     
  3. ErwanG

    ErwanG Regular Pleskian

    20
    57%
    Joined:
    Apr 29, 2010
    Messages:
    121
    Likes Received:
    0
    Thanks Igor.

    Is there another solution to disable fonction mail() ?
     
  4. abdi

    abdi Platinum Pleskian

    31
    18%
    Joined:
    May 14, 2006
    Messages:
    2,913
    Likes Received:
    60
    You could do that from /etc/php.ini but that would affect the customer. Also you could try this out:

    Adding php extension flags in

    /var/www/vhosts/domain.com/conf/vhost.conf

    E.g

    <Directory /var/www/vhosts/domain.com/httpdocs>
    php_admin_value open_basedir none
    php_admin_value safe_mode 0
    php_admin_value display_errors 0
    php_admin_value file_uploads 1
    php_admin_value allow_url_fopen 1
    php_admin_value output_buffering 1
    php_admin_value memory_limit 64M
    </Directory>

    The finely

    /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain domain.com
     
  5. MislavO

    MislavO Regular Pleskian

    16
    85%
    Joined:
    Jul 20, 2012
    Messages:
    271
    Likes Received:
    1
    Location:
    Croatia
    You can also disable function e-mail in PHP settings within Plesk itself, just go to Websites & Domains, click on domain name, switch to PHP Settings tab, scroll to the end of page and type function "disable_functions = mail" in the textbox (without quotations).

    If you're doing that make sure your subscription is locked because of possible new sync to the hosting plan assigned tto this subscription (if subscription is not locked, your function "disable_functions = mail" will disapear and you will have to type it again and again). Your chooise.
     
  6. grumpydev

    grumpydev New Pleskian

    10
    85%
    Joined:
    Dec 2, 2012
    Messages:
    12
    Likes Received:
    0
    disable_functions not working

    I am trying to configure a hosting plan with disable_functions however after I do a sync, or make a change to the domain, the functions do not get populated in the domains <domain>/etc/php.ini file.

    Can someone please help me understand what I am doing wrong and how I make sure these changes get applied to the domains?

    Here is what i have:

    disable_functions = apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd, eval, exec, fp, fput, ftp_connect, ftp_exec, ftp_get, ftp_login, ftp_nb_fput, ftp_put, ftp_raw, ftp_rawlist, highlight_file, ini_alter, ini_get_all, ini_restore, inject_code, openlog, passthru, php_uname, phpAds_remoteInfo, phpAds_XmlRpc, phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, posix_setuid, posix_uname, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode


    then in the domain to apply this change I make a small modification and click ok. I see the domain go down briefly as apache is restarted, but the disable_functions do not get applied.

    I am using php 5.3 (php_safe mode is deprecated).
    According to the manual:
    >>
    This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode.

    Only internal functions can be disabled using this directive. User-defined functions are unaffected.

    This directive must be set in php.ini For example, you cannot set this in httpd.conf.
    <<

    Any assistance is greatly appreciated.
     
    Last edited: Dec 4, 2012
  7. SibProgrammer

    SibProgrammer Regular Pleskian Staff Member

    29
     
    Joined:
    Nov 21, 2004
    Messages:
    342
    Likes Received:
    15
    You have an answer in your question: "This directive must be set in php.ini For example, you cannot set this in httpd.conf."

    Also you can check the manual http://php.net/manual/en/ini.core.php See "Changeable" column. Directive disable_functions can be changed only via php.ini. This means that you should either modify the global php.ini config or use CGI/FastCGI PHP for particular domain.
     
Loading...