php.ini and mail.log file size limit


Well-Known Member
Feb 15, 2014
cPanel Access Level
Root Administrator
Hi, in order to track scripts that are sending emails through php mail() function, i've read about mail.log directive in php.ini that accepts either a user's home dir file or a path to a server, for example /var/log/php_mail.log

I'm using suphp so in order to write to a /var/log/php_mail.log i have to set 777 permissions to the file, if i want to have all my users logs to one file. It isn't a good idea for me to use a 777 file.

The other solution is to use a file like the error_log, inside the users home dir but the problem is that i didnt find any documentation about limiting the file size, so after a while the user's home dir will be over quota.

Is there a way to limit the file size through php.ini?
Or any other way to monitor mail() in a file containing all users, but not chmod to 777?

Thank you,