PDA

View Full Version : php mail header patch


hung
10-23-2004, 11:27 AM
Hi,

I just upgrade my PHP to 4.3.9, and apply your patch as well. However, in mail header it doesnt show IP of sender, like PHP 4.3.8 does. I am using FC1, RH9 with cPanel. Is there anything missing in that patch?

thanks,
Hung

choon
10-24-2004, 12:39 AM
Nothing is missing... just take a look at your source php... /home/cpapachebuild/buildapache/php-4.3.9/ext/standard/mail.c to see anything commented under my name.

hung
10-24-2004, 01:11 AM
yup, sorry Choon. Searching "choon" in mail.c returns nothing. I just follow steps in WHM/cPanel section in your instructure.

However, checking in cpanel-buildapache file in root, I see no PHP 4.3.9 patch there.

choon
10-24-2004, 01:53 AM
No, delete the tarball:
rm cpanel-php-mail-header-02-Oct-2004.tar.gz
rm -f /root/cpanel-buildapache*
Then redownload as per the instruction in the page.

hung
10-24-2004, 09:10 AM
ok, it's working now. thanks for great work, Choon ;)

:beer:

choon
10-24-2004, 09:16 AM
Glad it is working fine now ;)

RapidFire
10-25-2004, 04:41 AM
:v2: CHOON :v2:


Hahaha. :)


(crap post)

lack of :sleep: .

:beer:

choon
11-26-2004, 05:25 AM
Ok, FYI... updated to support php version 5.0.2 but personally I haven't test though :p

If anyone tested it, please let me know the result.

Thanks.

choon
12-17-2004, 12:49 PM
Updated to support 4.3.10 and 5.0.3 ;)

choon
04-02-2005, 09:56 PM
Updated to support 4.3.11 and 5.0.4 ;)

Roman2K
05-21-2005, 05:30 PM
Hi Choon and thank you for your work on this patch.

I suppose the first goal of your patch is to know choch site uses mail function. That is what I want. I have Postfix mail server and PHP 4.3.10 that I patched with your patch.

Can you explain me where to get the informations given by the extra header of each mail ? For example can I get them in a file or whatever ?

Thank you in advance for your answer.

choon
05-21-2005, 10:02 PM
You can look in the message headers in the server mail queue or bounces if the mails are relayed from your server using one of the php script mail() function.

choon
05-22-2005, 02:13 AM
If you are not sure where is the postfix mail queue directory, use this command to check:
postconf -d
That will show you where is the location of the Postfix top-level queue directory ;)

Roman2K
05-22-2005, 07:34 PM
Thank you for your answer.

I still don't understand where to see the informations given by your patch.
My queue dir is /var/spool/postfix but there are directories and I don't understand what they are for.

Is there a method to log the informations fiven by your patch in a file ?
In fact I would like to cron a script that parses the log file and puts the values in database (for example it should increment the row "quota" in the table "domains" where the row "domain" is equal to the servername.

I hope that you understand me and I don't annoy you.

choon
05-22-2005, 07:55 PM
When you send emails from your server or when there are people sending mails to your server, your Mail Transport Agent (MTA) will store all the mails in its mail queue directory so that it will deliver those mails to its respective receiptant. You can use this command to find all the files in your mail queue directory and have a look in it:
find /var/spool/postfix -type f

There is no way for you to log file given by my patch as it is patched against the php source for the mail() function which what it does is only adding one additional information to the mail header.

Hope this helps ;)

netty
09-13-2005, 12:42 AM
Can anyone here using "--enable-memory-limit" with PHP 4.4.0 confirm if it is working for them, along with the mail-header-patch.

When i recompiled PHP with this patch, it showed '--enable-memory-limit' in phpinfo "Configure Command" section, but "memory_limit" didnt appeared anywhere on the page and the "memory_get_usage" function didnt work too.

But as soon as i recompiled using a unptached source, everything worked fine right away.

choon
09-13-2005, 11:10 AM
Can anyone here using "--enable-memory-limit" with PHP 4.4.0 confirm if it is working for them, along with the mail-header-patch.

When i recompiled PHP with this patch, it showed '--enable-memory-limit' in phpinfo "Configure Command" section, but "memory_limit" didnt appeared anywhere on the page and the "memory_get_usage" function didnt work too.

But as soon as i recompiled using a unptached source, everything worked fine right away.
Hi netty, for your information... I have no problem with using --enable-memory-limit in php 4.4.0 as well as memory_get_usage function for more than 10 WHM/cPanel servers I managed. Perhaps you might want to try to recompile but before you do so, please remove all the old files for my scripts and the php build directory?

netty
09-13-2005, 11:31 PM
Thanks for the response.

Can you tell me your ./configure command

choon
09-13-2005, 11:37 PM
If you ask me about which configuration option i used for my own server here it is:
http://choon.net/phpinfo.php

<EDIT>Sorry, just to make clear... my server is not using WHM/cPanel</EDIT>

choon
11-04-2005, 01:01 AM
Updated to support version 4.4.1 ;)

Root
11-21-2005, 05:20 PM
Will this work with the "Apache Update" function within cPanel's WHM?

I was wondering if it's absolutely necessary to run "/scripts/easyapache" or if it could be done using the equivalent function in WHM.

Root
11-21-2005, 07:11 PM
Will this work with the "Apache Update" function within cPanel's WHM?

I was wondering if it's absolutely necessary to run "/scripts/easyapache" or if it could be done using the equivalent function in WHM.
Answered my own question; it does work!

Instead of using "/scripts/easyapache", I used WHM's "Apache Update" function instead. :)

Thank you Choon!

choon
11-21-2005, 08:09 PM
Answered my own question; it does work!

Instead of using "/scripts/easyapache", I used WHM's "Apache Update" function instead. :)

Thank you Choon!
LOL... ok, good to know you found out yourself ;)

lgwong
11-26-2005, 09:59 AM
I try to install this patch for WMH/Cpanel by running the cpanel-buildapache inside anel-php-mail-header-03-Nov-2005.tar.gz. However, the script just stops after downloading the patch and seems never finish. Anything I have done wrong?

./cpanel-buildapache
--20:58:24-- http://choon.net/opensource/php/php-mail-header.patch
=> `/tmp/php-mail-header.patch'
Resolving choon.net... done.
Connecting to choon.net[203.124.122.19]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2,779 [text/plain]

100%[================================================== ===============================>] 2,779 10.36K/s ETA 00:00

20:58:26 (10.36 KB/s) - `/tmp/php-mail-header.patch' saved [2779/2779]

choon
11-26-2005, 11:13 AM
Please re-read the instruction carefully:
/root/cpanel-buildapache &
Then press enter... and continue with your /scripts/easyapache.

lgwong
11-27-2005, 08:18 AM
But cpanel-buildapache just keep running when I run ps. When will it stop?

choon
11-27-2005, 08:28 AM
After you finish running /scripts/easyapache to compile and install apache and php ;)

jugo
09-08-2006, 12:17 AM
Just to verify...

This works on PHP 4.4.x?? <<---Just Read the changelog..sorry....

I will attempt to rerun the patch for my server as I cannot see the X-PHP Line in any of the headers.

tanfwc
09-13-2006, 09:37 AM
Just to verify...

This works on PHP 4.4.x?? <<---Just Read the changelog..sorry....

I will attempt to rerun the patch for my server as I cannot see the X-PHP Line in any of the headers.

Remember to re-compile your Apache :D

jugo
09-20-2006, 03:04 AM
I did...

it's a bit sporradic. It misses about 10% of emails...but otherwise it works well..

choon
09-20-2006, 05:23 AM
I do not see why it will miss since it modified the mail() function during compilation of php and not during run time... ...

choon
11-12-2006, 01:25 PM
I have released a new patch to fix a potential security risk thus kindly download the new release patch and recompile your php for those who are using my patch in the past. Thanks.