Portal Home > Knowledgebase > Articles Database > Disable Mail Function


Disable Mail Function




Posted by PNH-Madih, 05-21-2008, 08:56 PM
Well I am starting to webhosting company in it I have included a package will be free and add supported and also I want to disable some functions like mail() ..........I mean I want to disable SMTP services anyone have idea how can I do that.

Posted by Paul, 05-21-2008, 10:18 PM
http://us3.php.net/manual/en/feature...able-functions iptables on port 25 to do UID matching against "Free" clients.

Posted by unity100, 05-21-2008, 10:34 PM
use mailmon

Posted by PNH-Madih, 05-21-2008, 11:28 PM
But by this method the mail function is disable through out all servers .............I wanted that in free accounts mail() function should be blocked while in paid account it works as normal

Posted by SSHocker, 05-22-2008, 12:13 AM
Moved to "Technical & Security Issues"

Posted by WCTisha, 05-22-2008, 12:16 AM
I suggest disable mail() entirely and just use smtp for the paying clients....

Posted by PNH-Madih, 05-22-2008, 04:38 AM
Well do you think disabling the mail() function entirely will be a good idea because many users dont know programming and in many ready made scripts like VBulettin , SMF and other scripts mail() function is used. So I simply want that free users should not have mail() function and paid users should have inone server thanks.

Posted by karem, 05-22-2008, 04:51 AM
paynhost i think u cant do it in seem server also good scripts can using mail or smtp like VBulettin , IBB Regards

Posted by PNH-Madih, 05-22-2008, 05:08 AM
hmm karem do you mean that it is not possible to block mail() function to single cpanel account...........Do anyone to disable mail() function in single cpanel acct while other should work fine. Last edited by PNH-Madih; 05-22-2008 at 05:15 AM.

Posted by david510, 05-22-2008, 10:07 AM
If you need to disable mail function in php add "mail" to the disable_functions list in php.

Posted by PNH-Madih, 05-22-2008, 10:13 AM
Well Please Explain that so I can do that

Posted by david510, 05-22-2008, 10:19 AM
Execute the folowing command on the server. php -i | grep php.ini You will get the php.ini file path. Open that file and search for the word disable_functions. Edit as follows and restart apache. disable_functions = mail

Posted by karem, 05-22-2008, 10:35 AM
david510 this method also will disable mail to all of accounts the man asking how can disable it foe some accounts and enable it for some accounts ...

Posted by Srv24x7, 05-22-2008, 11:16 AM
Well for free accounts why don't you create a package which will not have email features and remove the domain names from config files which allows email relaying. I think that will be a good way instead of blocking the mail function which will effect other users on the server as well.

Posted by david510, 05-22-2008, 12:11 PM
If the php on the server is compiled as CGI, he can make a local php.ini file inside the folder he wish to disable mail function and adding the following line to that file. disable_functions = "mail"

Posted by bin_asc, 05-22-2008, 12:31 PM
But if he does do that in the clients account, then the user can also edit the file. Another thing is, even if he does chown to root, and he`s using suPHP, he`ll have even more issues.

Posted by PNH-Madih, 05-22-2008, 07:50 PM
Thank You David that works.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Language: