php-mail.log

unihostbrasil

Verified User
Joined
Nov 23, 2009
Messages
210
Location
São Paulo - Brazil
Hello Martynas,

The CustomBuild 2.0 FAQ says that the default "x_mail_header" option enables the following PHP directives:

mail.add_x_header
mail.log


But it currently enables just the first PHP directive. The "mail.log" lines are all commented on CustomBuild script:

Code:
#		touch /var/log/php-mail.log
#		chmod 666 /var/log/php-mail.log
#		/usr/bin/perl -pi -e 's#;mail.log =\n#mail.log = /var/log/php-mail.log\n#' php.ini-${PHPINITYPE_OPT}

Why the "mail.log" directive is not enabled by the script? It is very useful!

Thanks.
 
Hello,

It's planned for the future to place the log under each user's homedir.

Thank you.
 
Last edited:
Why was x-mail-header=yes added as default to options.conf in cb 2.0 recently? I mean why do you add it as default before it is ready? Because it does not work yet.

After you changed the above, and I recompiled php, I got this:

Code:
Enabling mail.log and mail.add_x_header options in /usr/local/lib/php.ini
--2013-08-13 19:30:07-- 
http://files1.directadmin.com/services/custombuild/php-mail.logrotate
Resolving files1.directadmin.com... 216.144.254.90
Connecting to files1.directadmin.com|216.144.254.90|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-08-13 19:30:08 ERROR 404: Not Found.

Then I recompiled php one more time, and the error went away, and it only said this:
Code:
Enabling mail.log and mail.add_x_header options in /usr/local/lib/php.ini

Then I see this line was automatically added in php.ini:
Code:
mail.log = /var/log/php-mail.log

However /var/log/php-mail.log does not exist. So this does not work and is not ready. So again, why do cb 2.0 add "x-mail-header=yes" to options.conf before it is actually working?
 
You seem to be running an old version of CB. Please run "./build update". Only mail.add_x_header is added with the option.
 
No, I am running the newest version of cb 2.0, always. What I desribed above, happened to me on all my 4 servers around 14 of august. I reported it on email to DirectAdmin support at that time. Maybe you have changed/fixed some of it after that. When I recompile php now, I only get the line (in the output):

Enabling mail.log and mail.add_x_header options in /usr/local/lib/php.ini

So no errors. However you did not answer the question? Why is x-mail-header=yes added as default to options.conf when it not yet works? And also then you add mail.log = /var/log/php-mail.log to php.ini, but php-mail.log does not exist. So why does custombuild 2 enable it?

I need to know if I should overrule the default in custombuild 2.0 and change x-mail-header=yes to be x-mail-header=no
 
Why is x-mail-header=yes added as default to options.conf when it not yet works?
It just enables mai.add_x_header option in php.ini, which works with no problems, and does nothing with mail.log. It was only a short period of time when mail.log was used in CB 2.0, but later, together with John, we decided to leave it for the future and place logs of PHP (mail) into every user's homedir.
And also then you add mail.log = /var/log/php-mail.log to php.ini, but php-mail.log does not exist. So why does custombuild 2 enable it?
The starter of the thread already meantioned that it is NOT added to php.ini. I would strongly suggest you to check the CustomBuild scipt if you really run the latest version. The message you should get is:
CustomBuild said:
Enabling mail.add_x_header option in php.ini

To update, you can simply run:
Code:
wget -O /usr/local/directadmin/custombuild/build [URL]http://files1.directadmin.com/services/custombuild/2.0/custombuild/build[/URL]
Thank you for your questions.
 
[..]It was only a short period of time when mail.log was used in CB 2.0, but later, together with John, we decided to leave it for the future and place logs of PHP (mail) into every user's homedir.

So, that explains it. However it left me guessing. That is why custombuild 2.0 added mail.log = /var/log/php-mail.log into my php.ini, THEN YOU REVERTED IT LATER.

I AM RUNNING THE LATEST VERSION OF CB 2, HOWEVER I DO NOT RECOMPILE PHP EVERY DAY. MY PHP.INI WAS CHANGED BY CB 2 BEFORE YOU REVERTED YOUR CODE.

I will change php.ini myself. End of story.
 
I checked now, and I am on cb 2 rc6, its been rc6 for some time now.

+--------------------------------------------------------+
| |
| DirectAdmin WebServices Installer |
| Written by Martynas Bendorius and DirectAdmin |
| Version: 2.0.0-RC6 |
| |
+--------------------------------------------------------+
 
Around 14 of august the newest version of cb 2.0 added this line to my php.ini:

mail.log = /var/log/php-mail.log

I need you to tell me what I should change it to be? What should it be?????
 
Just add ; at the beginning of the line and it will solve the problem.
Code:
[COLOR=#333333]; mail.log = /var/log/php-mail.log[/COLOR]
 
Thanks for the clarification, Martynas.

My suggestion is to keep the "mail.log" directive active in the old way (/var/log/php-mail.log) until the new per-user directory implementation, as it is very useful for tracking purposes.

The related problem by ditto happened at all of our servers too. The CustomBuild from the last week enabled the mail.log directive but has not created the /var/log/php-mail.log file. This caused all php scripts using the mail() function to show an error:

Warning: mail(/var/log/php-mail.log): failed to open stream: Permission denied in /home/xxxxxxx on line xxxxx
 
Back
Top