Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#26 2013-09-03 22:20:23

sklerder
Member
From: Brittany
Registered: 2012-11-06
Posts: 117
Website

Re: FluxBB 1.5.4 and 1.4.11 released

Hello again smile

Finally, I took time to test it on my "draft" forum (Postfix too, Linux OS too, I don't know which versions, "mutualized" case).

I defined a "FLUXBB_EOL" constant in "/config.php" :

// To handle line breaks in mail headers
// possible values can be : PHP_EOL, "\r\n", "\n" or "\r"
// Original value is PHP_EOL (handled by the OS)
define ('FLUXBB_EOL', PHP_EOL);

And modified the two lines defining "$headers" that were modified by 1.5.4 in "/include/email.php" :

	$headers = 'From: '.$from.FLUXBB_EOL.'Date: '.gmdate('r').FLUXBB_EOL.'MIME-Version: 1.0'.FLUXBB_EOL.'Content-transfer-encoding: 8bit'.FLUXBB_EOL.'Content-type: text/plain; charset=utf-8'.FLUXBB_EOL.'X-Mailer: FluxBB Mailer';

	// If we specified a reply-to email, we deal with it here
	if (!empty($reply_to_email))
	{
		$reply_to = '"'.encode_mail_text($reply_to_name).'" <'.$reply_to_email.'>';

		$headers .= FLUXBB_EOL.'Reply-To: '.$reply_to;

And the results, now :
- With FLUXBB_EOL defined to PHP_EOL, it's OK (headers are not broken, UTF-8 is OK)
- With FLUXBB_EOL defined to "\n", it's OK (headers are not broken, UTF-8 is OK)
- With FLUXBB_EOL defined to "\r\n", it's not OK (headers are broken, UTF-8 is bad)
- With FLUXBB_EOL defined to "\r", it's not OK (headers are not broken, UTF-8 is bad)

So, the simple constant in "/config.php" is really usable.



[Out of subject]
Remarks on this test :
This tends to demonstrate that (with Postfix, another MTA could behave differently) :
- The use of "\r" is responsible of the UTF-8 breaking
- The use of "\r\n" is responsible of UTF-8 breaking and headers breaking

Here is an extract of the header when using only "\r" as value for FLUXBB_EOL :

Received: by mydomain.org (Postfix, from userid 9500)
    id 2D231554001; Tue,  3 Sep 2013 23:44:33 +0200 (CEST)
To: myuser@mymail.domain
Subject: =?UTF-8?B?Vm91cyBhdmV6IHJlw6d1IHVuIG5vdXZlYXUgbWVzc2FnZSBwcml2w6kgc3VyIE9yYW5nZSBTYW5zIEd1aWduZQ==?=
From: "xxxxxxx E-mail automatique" <myuser@mymail.domain>Date: Tue@mydomain.org,
    03 Sep 2013 21:44:33 +0000 MIME-Version:1.0 Content-transfer-encoding:8bit Content-type: text/plain@mydomain.org ;,
    charset=utf-8@mydomain.org, "X-Mailer:FluxBB"@mydomain.org,
    Mailer@mydomain.org

Message-Id: <20130903214433.2D231554001@mydomain.org >
Date: Tue,  3 Sep 2013 23:44:33 +0200 (CEST)

The "\r" has a strange effect on headers hmm
[/Out of subject]

Offline

#27 2013-09-03 22:38:19

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,431
Website

Re: FluxBB 1.5.4 and 1.4.11 released

Let's do this then.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#28 2013-09-04 19:32:44

sklerder
Member
From: Brittany
Registered: 2012-11-06
Posts: 117
Website

Re: FluxBB 1.5.4 and 1.4.11 released

Hi.

I posted a request in the previous ticket, I felt it would be more easy to understand all the history of the problem.

[Edit]
Finally, the ticket is #897
[/Edit]

Last edited by sklerder (2013-09-04 19:52:50)

Offline

Board footer

Powered by FluxBB