Hi, How do I stop the PHP applications from sending mails ? I've tried enforcing smtp login in postfix/dovecot. Running ISPConfig3 on Ubuntu 12.04 Regards
Hi, To simply disable mail() function in php you can edit your php.ini, then add the following line: disabled_functions = mail and restart your webserver (apache or nginx). Let me know if you need further help.
The mail system is used by all kind off applications and cronjobs, not just php. So you cant enforce smpt-auth on the postfix sendmail wrapper. The only thing that I can think of is that you try to reconfigure postfix to send mails only locally (bind it to 127.0.0.1) so nobody can send out mails from this server. But this can onyl work if its a pure webserver and not also a mailserver. Your websites can use your external mailserver then by smtp auth only.
i put disabled_functions = mail in php.ini, and service apache2 restart, but still i can send mail from web. i put disabled_functions = mail in ispconfig3 directive php snippets, but still i can send mail from web. in php.net disabled_functions doesn't exist. how it work, where is problem?
The settings is: disable_functions = mail and not disabled_functions = mail but this will dsallow only the php mail() function, there are other ways to send mail like the postfix sendmail warpper or smtp libraries written in php.
hi, i try change sendmail path in php.ini but phpinfo show me other config. Where can be other sendmail path config? ubuntu 14 ispconfig
i want put php script wrapper for control local mysql recipient send from www-data. Any idea where i connect custom script to php sendmail ? thank you
very nice tutorial and script. But i have one problem: in /etc/php5/cgi/php.ini i put line sendmail_path = /usr/local/bin/phpsendmail, and mail wrapper not work, no line writed in mail_php.log after send mail with php mail() function, phpinfo show me this: Loaded Configuration File /etc/php5/cgi/php.ini sendmail_path/usr/sbin/sendmail -t -i [email protected] but in /etc/php5/cgi/php.ini is writed sendmail_path = /usr/local/bin/phpsendmail i have instaled ispconfig 3 and i never used mailbox webmaster. Its any autoconfigured, but where i find it?
Hi, If you're using apache webserver you also need to edit /etc/php5/apache2/php.ini and restart the Apache webserver to apply the changes.
did you edit /etc/php5/apache2/php.ini ?? The tutorial says, "If you use php as cgi, with suphp or as fcgi, then change the same lines in the file /etc/php5/cgi/php.ini, too." You seem to just have edited /etc/php5/cgi/php.ini and not /etc/php5/apache2/php.ini Kindly verify.
yes, i understand it, i changed php.ini in all folder in /etc/php5, in apache2, in cgi, in cli, and in fpm. and i restarted apache2. ok. but php function phpinfo() in web folder show me this: Loaded Configuration File /etc/php5/cgi/php.ini and sendmail_path/usr/sbin/sendmail -t -i [email protected] but in /etc/php5/cgi/php.ini is writed sendmail_path = /usr/local/bin/phpsendmail and no other line sendmail_path and this i dont understand. its posible that postfix config or ispconfig overwrited it? where?
No. IMO neither postfix nor ISPC will overwrite it. I am sure you must have but still for confirmation, did you restart php-fpm ??
i restarted php5-fpm but problem still persist. I have already solved, with renaming files. sendmail i renamed sendmailx and phpsendmail-wrapper i renamed as sendmail and i put it on /usr/sbin now work fine sendmail wrapper. php.ini sendmail line remains a mystery.