Forums

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

You are not logged in.

#1 2012-04-28 02:47:28

Reines
Lead developer
From: Scotland
Registered: 2008-05-11
Posts: 3,195
Website

Email issues

Has there been any changes to the email sending code recently?

I'm seeing some mime information in my subscription emails that shouldn't be there. They look like the following:

Date: Fri, 27 Apr 2012 19:44:38 +0000

MIME-Version: 1.0

Content-transfer-encoding: 8bit

Content-type: text/plain; charset=utf-8

X-Mailer: FluxBB Mailer
Message-Id: <20120427194438.1F9A1F8BB@robin.fluxbb.org>

Studio384 has replied to the topic 'FluxBB 1.5-beta released' to which you are subscribed. There may be more new replies, but this is the only notification you will receive until you visit the board again.

The post is located at https://fluxbb.org/forums/viewtopic.php?pid=46009#p46009

The message reads as follows:
-----------------------------------------------------------------------

I'm happy with it, I yesterday upgrade my forum on my portfolio (and FluxBB Vlaanderen / Nederland) to this béta, until now: no problems...

-----------------------------------------------------------------------

You can unsubscribe by going to https://fluxbb.org/forums/misc.php?action=unsubscribe&tid=6304

--
FluxBB Forums Mailer
(Do not reply to this message)

Offline

#2 2012-04-28 13:40:24

Lanark
Member
Registered: 2008-10-27
Posts: 71

Re: Email issues

I've noticed this too, since April 26th but I haven't updated Flux recently.

I think maybe gmail is messing up the header somehow?
The messages look wrong in both the gmail web app and in Thunderbird.

Looking at the message headers, the only difference I can see is the line spacing (most likely CR/LF line endings)

Before:

Date: Tue, 10 Apr 2012 07:16:44 +0000
MIME-Version: 1.0
Content-transfer-encoding: 8bit
Content-type: text/plain; charset=utf-8
X-Mailer: FluxBB Mailer


After:

Date: Thu, 26 Apr 2012 03:56:16 +0000

MIME-Version: 1.0

Content-transfer-encoding: 8bit

Content-type: text/plain; charset=utf-8

X-Mailer: FluxBB Mailer

Last edited by Lanark (2012-04-29 11:47:15)

Offline

#3 2012-04-29 18:35:36

quy
Developer
From: California
Registered: 2008-05-09
Posts: 845

Re: Email issues

I was having this issue on my install. I did the following in /include/email.php to fix it. Changed "\r\n" to PHP_EOL.

find:

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

replace:

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

find:

$headers .= "\r\n".'Reply-To: '.$reply_to;

replace:

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

Last edited by quy (2012-04-29 18:36:24)

Offline

#4 2012-04-29 22:37:31

Reines
Lead developer
From: Scotland
Registered: 2008-05-11
Posts: 3,195
Website

Re: Email issues

The SMTP protocol says line breaks should be CRLF, but PHP.net says they should be LF only. We use CRLF. Perhaps related?

Offline

#5 2012-05-03 07:13:15

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,776
Website

Re: Email issues

It works fine for report notification emails. Strange.


fluxbb.de | develoPHP

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

Offline

#6 2012-05-03 17:06:11

Reines
Lead developer
From: Scotland
Registered: 2008-05-11
Posts: 3,195
Website

Re: Email issues

It seems to have fixed now - confused!

Offline

#7 2012-05-03 23:01:10

arw
Member
Registered: 2012-03-20
Posts: 117

Re: Email issues

i think it's that issue :  https://groups.google.com/a/googleprodu … 1VjysBzIgJ

and google fixed it ( and explained the issue )

Offline

#8 2012-05-06 19:09:02

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,776
Website

Re: Email issues

If I understand that guy's explanation correctly, it would be better to use \n instead of \r\n, because that's how PHP adds the first header anyways (even though that's technically incorrect).

Is that right?


fluxbb.de | develoPHP

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

Offline

#9 2012-05-07 00:12:46

arw
Member
Registered: 2012-03-20
Posts: 117

Re: Email issues

according to this https://bugs.php.net/bug.php?id=15841 it seems like it's because in unix \n will be replaced by \r\n by sendmail/postfix ( so if anything it seems like PHP_EOL is the better )

Offline

#10 2012-05-07 00:26:52

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,776
Website

Re: Email issues

arw wrote:

according to this https://bugs.php.net/bug.php?id=15841 it seems like it's because in unix \n will be replaced by \r\n by sendmail/postfix ( so if anything it seems like PHP_EOL is the better )

Well, yes, exactly.

But Postfix seems to only be checking the first linebreak, and if that is an \n (as it always is in PHP), it will replace all \n by \r\n, which causes problems if, like in our case, the following linebreaks (which we added ourselves, not PHP automatically) are \r\n.


fluxbb.de | develoPHP

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

Offline

#11 2012-05-07 09:04:49

arw
Member
Registered: 2012-03-20
Posts: 117

Re: Email issues

yes, so PHP_EOL which is \n on unix and \r\n on windows should be the solution  ( since windows doesn't use sendmail / postfix )

Offline

#12 2012-05-07 14:31:20

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,776
Website

Re: Email issues

Ticket created. This will be fixed in v1.5.1.


fluxbb.de | develoPHP

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

Offline

#13 2012-12-20 22:11:43

Dr Parnas
Member
Registered: 2012-12-16
Posts: 6

Re: Email issues

Thanks.

Offline

#14 2013-03-20 07:31:30

huaruyue
New member
Registered: 2013-03-19
Posts: 1

Re: Email issues

The messages look wrong in both the gmail web app and in Thunderbird.、。。。

Last edited by huaruyue (2013-03-20 07:32:49)

Offline

#15 2013-03-20 09:26:34

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,776
Website

Re: Email issues

Hello. smile

What do you mean by "wrong"? They look just fine to me...


fluxbb.de | develoPHP

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

Offline

#16 2014-03-17 04:17:47

erinwcharles
New member
Registered: 2014-03-17
Posts: 2

Re: Email issues

They are fine for me.

Offline

Board footer

Powered by FluxBB 1.5.6