[solved] Bare Linefeeds in HTML messages

Solutions for other advanced phplisters

[solved] Bare Linefeeds in HTML messages

Postby joel.gibby » 7:57pm, Thu 12 Apr, 2007

Our installation of PHPList (2.10.3) sends out "HTML and Text" emails with bare linefeeds (\n) instead of proper linefeeds with carriage returns (\r\n). We are getting mail bounced from numerous domains with error

"451 - See http://pobox.com/~djb/docs/smtplf.html "

Which describes that bare linefeeds violate SMTP RFCs. Are there any provisions for this in PHPList? Am I misconfigured somewhere? I checked a packetcapture of the messages and they in fact do include bare linefeeds.

Help!
joel.gibby
phpLister
 
Posts: 7
Joined: 7:36pm, Thu 12 Apr, 2007

Postby joel.gibby » 4:39pm, Fri 13 Apr, 2007

Anybody?

We are a school district that is trying to keep parents updated about their childrens schools, but our email is getting rejected! Thanks to anyone who can help.

Joel
joel.gibby
phpLister
 
Posts: 7
Joined: 7:36pm, Thu 12 Apr, 2007

Postby H2B2 » 6:33pm, Fri 13 Apr, 2007

Phplist will generate a CR/LF (or \r\n) for message headers. So its hard to say why this problem is happening to (some??? or all??? of) your messages.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby joel.gibby » 8:42pm, Fri 13 Apr, 2007

It happens in text, text and HTML, and HTML messages created with FCKEditor.

It happens here (just after the header ends and continues for the rest of the message):

Message: \ttype="text/html";\r\n
Message: \tboundary="b1_9747cae5d74aa92a0ad7896e2b778bbd"\r\n
Message: X-OriginalArrivalTime: 13 Apr 2007 20:23:34.0550 (UTC) FILETIME=[9C4DD360:01C77E09]\r\n
Message: \r\n
Message: --b1_9747cae5d74aa92a0ad7896e2b778bbd\n
Message: Content-Type: text/html; charset = "iso-8859-1"\n
Message: Content-Transfer-Encoding: 8bit\n
Message: \n
Message: <html><head>\n

I wouldn't think this is an issue with FCKEditor since it's just generating HTML...?
joel.gibby
phpLister
 
Posts: 7
Joined: 7:36pm, Thu 12 Apr, 2007

Postby H2B2 » 9:45pm, Fri 13 Apr, 2007

You could run some tests to exclude or confirm possible causes.

For instance, to check whether FCKeditor has any part in this, try disabling FCKeditor in config.php and just paste the html code in the editing window on the message content tab.

And to check whether sendmail has anything to do with this, you could try enabling SMTP in config.php.
Make sure you read this too: http://mantis.phplist.com/view.php?id=8590
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby joel.gibby » 8:47pm, Mon 16 Apr, 2007

This is what happens with no FCKEditor (and TinyMCE disabled):

Message: X-OriginalArrivalTime: 16 Apr 2007 20:12:45.0854 (UTC) FILETIME=[98E3EBE0:01C78063]\r\n
Message: \r\n
Message: This is a multi-part message in MIME format.\r\n
Message: \r\n
Message: --b1_8246c4709946ec31f31873a4c8300351\r\n
Message: Content-Type: multipart/alternative;\r\n
Message: \tboundary="b2_8246c4709946ec31f31873a4c8300351"\r\n
Message: \r\n
Message: \r\n
Message: --b2_8246c4709946ec31f31873a4c8300351\r\n
Message: Content-Type: text/plain;\r\n
Message: \tcharset="iso-8859-1"\r\n
Message: Content-Transfer-Encoding: 7bit\r\n
Message: \r\n
Message: \n
Message: Test!\n
Message: \n
Message: Test!\n
Message: \n
Message: --\n

After implementing the bugfix in the link you gave, this is what I get:

Message: Content-Transfer-Encoding: 7bit\r\n
Message: \r\n
Message: \r\n
Message: Test! \r\n
Message: \r\n
Message: Test!\r\n
Message: \r\n
Message: \r\n

THANK YOU!! It worked.
joel.gibby
phpLister
 
Posts: 7
Joined: 7:36pm, Thu 12 Apr, 2007

Postby hola » 12:48am, Tue 17 Apr, 2007

Sorry, what was the bug fix? The only link provided in this thread is the link to a mantis bug report about the SMTP switch being buggy.

Cheers
hola
PL Geek
 
Posts: 53
Joined: 6:20am, Thu 02 Mar, 2006

Postby joel.gibby » 3:21pm, Tue 17 Apr, 2007

He listed a quick workaround in his SMTP mailer bug report - it looks like my PHPList installation was using the mail() function even though I specified to use SMTP. There's a flawed conditional (read the report) After changing the code as specified in the link - the mail came through correctly with proper carriage returns and linefeeds.
joel.gibby
phpLister
 
Posts: 7
Joined: 7:36pm, Thu 12 Apr, 2007

Postby hola » 9:25pm, Tue 17 Apr, 2007

Yep understood - then wouldn't that mean that the php mail function is buggy?

Cheers

Marc
hola
PL Geek
 
Posts: 53
Joined: 6:20am, Thu 02 Mar, 2006

Postby J_S » 6:24pm, Mon 19 May, 2008

mmm..
define 'buggy'
J_S
Admin
 
Posts: 674
Joined: 10:18pm, Fri 11 Apr, 2003

Postby Guest » 8:56am, Thu 07 Aug, 2008

Wouldn't it be better to check for empty/not empty PHPMAILERHOST to determine whether to use SMTP or mail()? According to the config file,
To use a SMTP please give your server hostname here, leave it blank to use the standard PHP mail() command.


This eol issue has been around for years, and has a number of causes:
http://bugs.php.net/bug.php?id=15841
Guest
 


Return to Advanced Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 0 guests