Re: [SM-PLUGINS] Squirrelmail, HTML Mail, and PHP5

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [SM-PLUGINS] Squirrelmail, HTML Mail, and PHP5

Tomas Kuliavas
> I also tried installing the latest Fedora 4 test release of PHP 5.0.5
> (php-5.0.5-2.1.i386.rpm).  It made no difference to 1.5.1, but 1.4.5
> would no longer display the main message list.

there is an entry in 1.4.6cvs changelog. something about php 5.1 and
array_shift() function. Same thing applies to php 5.0.5. See bug tracker
number that is listed in changelog.

--
Tomas


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
--
squirrelmail-plugins mailing list
Posting Guidelines: http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines
List Address: [hidden email]
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.plugins
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3931
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [SM-PLUGINS] Squirrelmail, HTML Mail, and PHP5

Jack-14
Tomas Kuliavas wrote:
I also tried installing the latest Fedora 4 test release of PHP 5.0.5
(php-5.0.5-2.1.i386.rpm).  It made no difference to 1.5.1, but 1.4.5
would no longer display the main message list.
    

there is an entry in 1.4.6cvs changelog. something about php 5.1 and
array_shift() function. Same thing applies to php 5.0.5. See bug tracker
number that is listed in changelog.

  
From ChangeLog:
- Fixes for increased error checking in PHP 5.1 array_shift() (#1237160). [php5]

http://sourceforge.net/tracker/index.php?func=detail&aid=1237160&group_id=311&atid=423679

I have already tried the latest 1.4.6 snapshot, which includes this fix, and the problem is still there.

Is there any reason to think it might be fixed in the latest CVS?  But the problem may be in the plugin itself -- are the add-on plugins available in CVS or as snapshots?

--

Jack
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [SM-PLUGINS] Squirrelmail, HTML Mail, and PHP5

Tomas Kuliavas
> Tomas Kuliavas wrote:
>>> I also tried installing the latest Fedora 4 test release of PHP 5.0.5
>>> (php-5.0.5-2.1.i386.rpm).  It made no difference to 1.5.1, but 1.4.5
>>> would no longer display the main message list.
>>>
>>
>> there is an entry in 1.4.6cvs changelog. something about php 5.1 and
>> array_shift() function. Same thing applies to php 5.0.5. See bug tracker
>> number that is listed in changelog.
>>
>>
>  From ChangeLog:
> - Fixes for increased error checking in PHP 5.1 array_shift()
> (#1237160). [php5]
>
> http://sourceforge.net/tracker/index.php?func=detail&aid=1237160&group_id=311&atid=423679
>
> I have already tried the latest 1.4.6 snapshot, which includes this fix,
> and the problem is still there.
>
> Is there any reason to think it might be fixed in the latest CVS?  But
> the problem may be in the plugin itself -- are the add-on plugins
> available in CVS or as snapshots?

quick diagnostics.

html_mail 2.2 + php 5.0.5 creates recursive message object in compose_send
hook. recursive object is feeded to recursive writeBody function in
deliver class. There are no php error messages. Only apache process
segfaults. plugin does not create recursive object in php 4.3.10. Tested
squirrelmail 1.4.6cvs (20050910)

maybe Paul can locate right place in html_mail_alter_type_do() function
faster than me.

--
Tomas


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
--
squirrelmail-plugins mailing list
Posting Guidelines: http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines
List Address: [hidden email]
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.plugins
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3931
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [SM-PLUGINS] Squirrelmail, HTML Mail, and PHP5

Paul Lesniewski


Tomas Kuliavas wrote:

>>Tomas Kuliavas wrote:
>>
>>>>I also tried installing the latest Fedora 4 test release of PHP 5.0.5
>>>>(php-5.0.5-2.1.i386.rpm).  It made no difference to 1.5.1, but 1.4.5
>>>>would no longer display the main message list.
>>>>
>>>
>>>there is an entry in 1.4.6cvs changelog. something about php 5.1 and
>>>array_shift() function. Same thing applies to php 5.0.5. See bug tracker
>>>number that is listed in changelog.
>>>
>>>
>>
>> From ChangeLog:
>>- Fixes for increased error checking in PHP 5.1 array_shift()
>>(#1237160). [php5]
>>
>>http://sourceforge.net/tracker/index.php?func=detail&aid=1237160&group_id=311&atid=423679
>>
>>I have already tried the latest 1.4.6 snapshot, which includes this fix,
>>and the problem is still there.
>>
>>Is there any reason to think it might be fixed in the latest CVS?  But
>>the problem may be in the plugin itself -- are the add-on plugins
>>available in CVS or as snapshots?
>
>
> quick diagnostics.
>
> html_mail 2.2 + php 5.0.5 creates recursive message object in compose_send
> hook. recursive object is feeded to recursive writeBody function in
> deliver class. There are no php error messages. Only apache process
> segfaults. plugin does not create recursive object in php 4.3.10. Tested
> squirrelmail 1.4.6cvs (20050910)
>
> maybe Paul can locate right place in html_mail_alter_type_do() function
> faster than me.

I don't have access to a PHP5 installation now, so it's a little hard.
I will take a peek, but don't have much time to dig in ATM.  Thanks for
looking at it.  HTML email is a bane....



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
--
squirrelmail-plugins mailing list
Posting Guidelines: http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines
List Address: [hidden email]
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.plugins
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3931
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [SM-PLUGINS] Squirrelmail, HTML Mail, and PHP5

Paul Lesniewski
In reply to this post by Tomas Kuliavas


Tomas Kuliavas wrote:

>>Tomas Kuliavas wrote:
>>
>>>>I also tried installing the latest Fedora 4 test release of PHP 5.0.5
>>>>(php-5.0.5-2.1.i386.rpm).  It made no difference to 1.5.1, but 1.4.5
>>>>would no longer display the main message list.
>>>>
>>>
>>>there is an entry in 1.4.6cvs changelog. something about php 5.1 and
>>>array_shift() function. Same thing applies to php 5.0.5. See bug tracker
>>>number that is listed in changelog.
>>>
>>>
>>
>> From ChangeLog:
>>- Fixes for increased error checking in PHP 5.1 array_shift()
>>(#1237160). [php5]
>>
>>http://sourceforge.net/tracker/index.php?func=detail&aid=1237160&group_id=311&atid=423679
>>
>>I have already tried the latest 1.4.6 snapshot, which includes this fix,
>>and the problem is still there.
>>
>>Is there any reason to think it might be fixed in the latest CVS?  But
>>the problem may be in the plugin itself -- are the add-on plugins
>>available in CVS or as snapshots?
>
>
> quick diagnostics.
>
> html_mail 2.2 + php 5.0.5 creates recursive message object in compose_send
> hook. recursive object is feeded to recursive writeBody function in
> deliver class. There are no php error messages. Only apache process
> segfaults. plugin does not create recursive object in php 4.3.10. Tested
> squirrelmail 1.4.6cvs (20050910)
>
> maybe Paul can locate right place in html_mail_alter_type_do() function
> faster than me.

Problem is likely around lines 1182 or 1189/90 where message object is
reshuffled for messages with attachments.  Code looks like the
following.  I wonder if assigning other variables to parts of an object
are creating references instead of copying values in PHP5.  Dunno.

            $message->entities[0]->mime_header->type1 = 'html';
            $htmlTextPart = $message->entities[0];

            $plainTextPart = new Message();
            $plainTextPart->body_part = $plainText;
            $mime_header = new MessageHeader;
            $mime_header->type0 = 'text';
            $mime_header->type1 = 'plain';
            $mime_header->encoding =
$message->entities[0]->mime_header->encoding;
            $mime_header->parameters =
$message->entities[0]->mime_header->parameters;
            $plainTextPart->mime_header = $mime_header;

            $message->entities[0]->mime_header->type0 = 'multipart';
            $message->entities[0]->mime_header->type1 = 'alternative';
            $message->entities[0]->mime_header->encoding = '';
            $message->entities[0]->mime_header->parameters = array();
            $message->entities[0]->body_part = '';

            // gets us a different message boundary
            $message->entities[0]->entity_id = 'usf' . mt_rand(1000, 9999);


            $message->entities[0]->entities = array($plainTextPart,
$htmlTextPart);



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
--
squirrelmail-plugins mailing list
Posting Guidelines: http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines
List Address: [hidden email]
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.plugins
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3931
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [SM-PLUGINS] Squirrelmail, HTML Mail, and PHP5

Tomas Kuliavas
>>>>>I also tried installing the latest Fedora 4 test release of PHP 5.0.5
>>>>>(php-5.0.5-2.1.i386.rpm).  It made no difference to 1.5.1, but 1.4.5
>>>>>would no longer display the main message list.
>>>>>
>>>>
>>>>there is an entry in 1.4.6cvs changelog. something about php 5.1 and
>>>>array_shift() function. Same thing applies to php 5.0.5. See bug
>>>> tracker
>>>>number that is listed in changelog.
>>>>
>>>>
>>>
>>> From ChangeLog:
>>>- Fixes for increased error checking in PHP 5.1 array_shift()
>>>(#1237160). [php5]
>>>
>>>http://sourceforge.net/tracker/index.php?func=detail&aid=1237160&group_id=311&atid=423679
>>>
>>>I have already tried the latest 1.4.6 snapshot, which includes this fix,
>>>and the problem is still there.
>>>
>>>Is there any reason to think it might be fixed in the latest CVS?  But
>>>the problem may be in the plugin itself -- are the add-on plugins
>>>available in CVS or as snapshots?
>>
>>
>> quick diagnostics.
>>
>> html_mail 2.2 + php 5.0.5 creates recursive message object in
>> compose_send
>> hook. recursive object is feeded to recursive writeBody function in
>> deliver class. There are no php error messages. Only apache process
>> segfaults. plugin does not create recursive object in php 4.3.10. Tested
>> squirrelmail 1.4.6cvs (20050910)
>>
>> maybe Paul can locate right place in html_mail_alter_type_do() function
>> faster than me.
>
> Problem is likely around lines 1182 or 1189/90 where message object is
> reshuffled for messages with attachments.  Code looks like the
> following.  I wonder if assigning other variables to parts of an object
> are creating references instead of copying values in PHP5.  Dunno.
>
>             $message->entities[0]->mime_header->type1 = 'html';
>             $htmlTextPart = $message->entities[0];
>
>             $plainTextPart = new Message();
>             $plainTextPart->body_part = $plainText;
>             $mime_header = new MessageHeader;
>             $mime_header->type0 = 'text';
>             $mime_header->type1 = 'plain';
>             $mime_header->encoding =
> $message->entities[0]->mime_header->encoding;
>             $mime_header->parameters =
> $message->entities[0]->mime_header->parameters;
>             $plainTextPart->mime_header = $mime_header;
>
>             $message->entities[0]->mime_header->type0 = 'multipart';
>             $message->entities[0]->mime_header->type1 = 'alternative';
>             $message->entities[0]->mime_header->encoding = '';
>             $message->entities[0]->mime_header->parameters = array();
>             $message->entities[0]->body_part = '';
>
>             // gets us a different message boundary
>             $message->entities[0]->entity_id = 'usf' . mt_rand(1000,
> 9999);
>
>
>             $message->entities[0]->entities = array($plainTextPart,
> $htmlTextPart);

$htmlTextPart = $message->entities[0];

$htmlTextPart is simple message object. entities parameter is empty array.

I think it is not referenced or reference is hidden somewhere else.
...

$message->entities[0]->entities[] = $htmlTextPart;

$message->entities[0] object becomes recursive.

copy ($htmlTextPart) of object ($message->entities[0]) is copied to
object's parameter ($message->entities[0]->entities[]). If $htmlTextPart
is a copy, then why it reflects changes in original object. I don't know
if I can prepare test script for php. Have other works on my weekend
schedule.

--
Tomas


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
--
squirrelmail-plugins mailing list
Posting Guidelines: http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines
List Address: [hidden email]
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.plugins
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3931
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [SM-PLUGINS] Squirrelmail, HTML Mail, and PHP5

Tomas Kuliavas
In reply to this post by Paul Lesniewski
>> quick diagnostics.

>>
>> html_mail 2.2 + php 5.0.5 creates recursive message object in
>> compose_send
>> hook. recursive object is feeded to recursive writeBody function in
>> deliver class. There are no php error messages. Only apache process
>> segfaults. plugin does not create recursive object in php 4.3.10. Tested
>> squirrelmail 1.4.6cvs (20050910)
>>
>> maybe Paul can locate right place in html_mail_alter_type_do() function
>> faster than me.
>
> Problem is likely around lines 1182 or 1189/90 where message object is
> reshuffled for messages with attachments.  Code looks like the
> following.  I wonder if assigning other variables to parts of an object
> are creating references instead of copying values in PHP5.  Dunno.
>
>             $message->entities[0]->mime_header->type1 = 'html';
>             $htmlTextPart = $message->entities[0];
>
>             $plainTextPart = new Message();
>             $plainTextPart->body_part = $plainText;
>             $mime_header = new MessageHeader;
>             $mime_header->type0 = 'text';
>             $mime_header->type1 = 'plain';
>             $mime_header->encoding =
> $message->entities[0]->mime_header->encoding;
>             $mime_header->parameters =
> $message->entities[0]->mime_header->parameters;
>             $plainTextPart->mime_header = $mime_header;
>
>             $message->entities[0]->mime_header->type0 = 'multipart';
>             $message->entities[0]->mime_header->type1 = 'alternative';
>             $message->entities[0]->mime_header->encoding = '';
>             $message->entities[0]->mime_header->parameters = array();
>             $message->entities[0]->body_part = '';
>
>             // gets us a different message boundary
>             $message->entities[0]->entity_id = 'usf' . mt_rand(1000,
> 9999);
>
>
>             $message->entities[0]->entities = array($plainTextPart,
> $htmlTextPart);
>
>
html_mail functions.php patch that works on 4.3.10 and 5.0.5 is attached.

http://www.php.net/manual/en/language.references.unset.php

I've unset $message->entities[0] and created new multipart/alternative
message object instead of altering existing message object headers.

Patch is experimental. If it breaks, see pine manual. :)

Test php 5.0.5 configure
-------
./configure' '--prefix=/somepath/php'
'--with-config-file-path=/somepath/config/'
'--with-apxs2=/somepath/apache/bin/apxs' '--disable-all'
'--enable-session' '--with-pcre-regex' '--enable-gettext=shared,/usr'
'--enable-mbstring=all,shared' '--enable-cli' '--enable-pear'
'--with-mysql=shared,/usr' '--with-pspell=shared,/usr'
'--enable-posix=shared'
--------

php.ini
-----
error_reporting=E_ALL
extension=ldap.so
extension=mysql.so
-----

.htaccess
-----
php_flag register_globals off
php_value include_path "/usr/share/php:/usr/share/fpdf/"
php_flag file_uploads on
php_flag short_open_tag off
php_flag asp_tags on
php_value error_reporting 2047
php_flag display_errors on
php_flag session.auto_start 0
php_value auto_prepend_file "/somepath2/session/session.php"
php_value mbstring.func_overload 0
php_value mbstring.internal_encoding utf-8
-----

Please note that this configuration is designed to break things. Be
careful with php configure and php_flag options. Understand what they do
before you use them.

php 4.3.10 is standard debian sarge package and shares same .htaccess as
php 5.0.5.

--
Tomas

functions.php.diff (2K) Download Attachment
Loading...