Knowledgebase

how to limit the number of messages the user nobody per day

Posted by AL-Kateb, 03-18-2010, 12:35 PM
Hello everybody, i have cPanel server on Centos i am using exim as the mail server and my scripts run as user nobody i want to know how to configure exim to prevent the user nobody from sending more than x number of messages per day. the option i tweak settings (maximum number of messages sent per domain) will not work for user nobody or how do i actually configure to work per user instead of per domain Thanks for your help

Posted by ClaudiuPopescu, 03-19-2010, 03:20 AM
The best option is to not allow the user nobody to send emails. There is an option in tweaks that allows you to do that. After, you simply recompile apache with suphp and suexec, and then every php script will run under it's own user instead of nobody. And now you should force your users to use smtp authentication in order to send emails from php scripts.

Posted by DME-Geoff, 03-19-2010, 04:38 AM
Incase you need to recompile apache and PHP to use suphp modules (which you will, if you disable nobody from sending mail in tweak settings) you can use the EasyApache feature inside WHM: Software Tab -> EasyApache (Apache Update) Click the "Previously Saved Config" Radio button Click "Start customizing based on profile" button Select apache 2.2 radio button -> next step Ensure PHP 5 is selected -> next step PHP 5.3.2 -> next step Select any modules you want to install for apache. Be careful adding modules you dont need or are unsure of as they will increase the amount of memory the apache processes are using. Click save and build *EDIT- Almost forgot..* After the build process has completed, click on "Service configuration -> apache configuration -> php and suexec configuration -> set PHP 5 Handler suphp -> apache suexec: on" Do not terminate the connection while this is running, it can mess up the configuration of PHP and apache, and unless you know how to fix it or your host is willing to help you, you're stuck.

Posted by AL-Kateb, 03-19-2010, 07:40 AM
Thanks for your suggestion right now the php handle is dso and i was thinking of goin to suphp but i was reading ppl complaining of it eating up too much resources.. well i do have 12 gb of ram and 8 cpus but i am still wondering if it's gonna cos any problems .. cos they always say it has side effects ... so i was unsure are those side effects regarding the load? or there are other side effects? scripts that wont be able to run when suphp is enabled? so i see there is no option to set the maximum number of messages the user nobody can send? and i will have to go for the suphp solution i guess? let's say i am using suphp now will the option (maximum messages each domain can send per hour) will be in effect? if not then how do i limit the number of messages each user can send per day? thanks for your help

Posted by madaboutlinux, 03-19-2010, 07:51 AM
Yes, if you enable SuPHP, the option "maximum messages each domain can send per hour" will work as per your expectation and even if the emails are sent via a script. BTW, if you enable SuPHP it does use up extra CPU resources but won't create too much of a problems on a 12GB RAM and 8 cpus server and server will be more secure than before.

Posted by shawn_linux, 03-19-2010, 08:07 AM
var/cpanel/cpanel.config file this is where you can set max emails per hours. max_emailconfig=0 means unlimited set it to 100 or any number you need. Once done you need to run command /scripts/build_maxemailconfig

Posted by AL-Kateb, 03-20-2010, 08:30 AM
Thanks for your help guys i recompiled php and apache using easy apache and now php is running as suphp but i was wondering will users have problems accessing files and dirs owned by user nobody? since now it's different user permission denied error might come up when someone is trying to edit a file owned by user nobody or something like that. i wonder if there is a script or something that chowns all files and dirs owned by nobody .. but do i need it anyway?

Posted by madaboutlinux, 03-20-2010, 08:47 AM
Yes, files under nobody ownership will create issues. Use the following script to correct ownership of all the files under all the accounts:

Posted by AL-Kateb, 03-20-2010, 09:08 AM
thanks madaboutlinux your script was a great help everything so far looks good .. lots of ppl said cpu usage will go crazy after using suphp but i noticed that it's nothing to mention thanks all for your help again



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read


Language:

Client Login

Email

Password

Remember Me

Search