Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues
Author Message
southoz
New Member
New Member



Joined: Feb 08, 2008
Posts: 6

PostPosted: Fri Apr 10, 2009 7:06 am Reply with quote

A number of my site users were not receiving topic reply and new PM emails.

To cut a long story short I have identifed the issue was an escape sequence carriage return \r after nX-MSMail-Priority: Normal on line 200 of modules/Forums/inlcudes/emailer.php

Effectively the header had a carriage return as well as a linefeed that was being rejected by some mail servers. Server that were accepting the email were considering X-MSMail-Priority: Normal to be the last line of the header and the below to be part of the message.

Quote:
X-Mailer: PHP
X-MimeOLE: Produced By phpBB2
Return-Path: xxxxxxxxxxxxxxxxxx
X-OriginalArrivalTime: 10 Apr 2009 10:43:15.0827 (UTC) FILETIME=[27745430:01C9B9C9]


After removing the carriage return \r escape sequence before the linefeed \n escape sequence all users were now receiving emails for topic reply and new PMs.

Hope this helps

Cheers
 
View user's profile Send private message Visit poster's website
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Mon Apr 13, 2009 6:59 am Reply with quote

That is odd to me. I am actually used to seeing \r\n between each of the headers. Are you able to send these same folks a group email from "Edit Groups"? Simple add them to a new test group and then use the email function with the same applet. I am pretty sure that code has it \r\n I am curious to see if it works.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
southoz







PostPosted: Mon Apr 13, 2009 2:46 pm Reply with quote

Similar Problem Exists however all lines after and including Reply to are now part of the message:

Quote:
Reply-To: xxxxxxxxxxxxx

X-Mailer: NSN Groups
Message-Id: <20090413204200.3334F3AC3065C@xxxxxxxxxxxxxxxxx>
Date: Tue, 14 Apr 2009 06:42:00 +1000 (EST)


PHP Version: PHP Version 5.2.6-2ubuntu4.1

At least this header wasn't rejected by the mail servers I was having problems with. I have also tested this with a hotmail account with similar results where the end of the header is becoming part of the message.

Looking at the function in the manual with respect to extra headers.

Quote:
Note: If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822.


Found this in the PHP Bugs which may provide a solution for us nix server admins.
[ Only registered users can see links on this board! Get registered or login! ]

Quote:
Ok guys, if it's not mail() which is wrong then
it's a documentation problem.
---cut---
Note: If messages are not received, try using a LF (\n) only. Some poor
quality Unix mail transfer agents replace LF by CRLF automatically
(which leads to doubling CR if CRLF is used). This should be a last
resort, as it does not comply with » RFC 2822.
---cut---

This is _not_ about "poor quality" MTAs or a "last resort".

The note should read:
Note: mail() talks to the sendmail command on Unix/Linux which
expects line endings to be the platform's native line endings
which is LF (\n) only on Unix/Linux and CRLF (\r\n) on Windows.
The sendmail will replace LF (\n) by CRLF (\r\n) automatically
to comply with RFC 2822. Thus you should use the special PHP_EOL
constant to separate mail headers.


So it appears that the extra headers need to be seperated by the PHP_EOL constant to make Ravennuke compatible with nix servers using sendmail as the MTA. This constant has only been available since 4.3.10 and 5.0.2 which would create more issues if people are using older installations.

I think I will just go and replay the \r\n in any email functions with PHP_EOL and let the guru's argue out what needs to be done to increase the compatibility of the premier Nuke Distro email functions for nix users. I will post any changes below to help others who may be having similar issues.


Last edited by southoz on Mon Apr 13, 2009 9:52 pm; edited 1 time in total 
southoz







PostPosted: Mon Apr 13, 2009 9:45 pm Reply with quote

Tested files where \r\n has been replaced with PHP_EOL to allow for nix compatibility with sendmail as the MTA

Forums Module
modules/Forums/includes/emailer.php
Line(s):200

GCalandar
admin/modules/GCalandar/common.inc.php
Line(s):797

NSN Groups
admin/modules/nsngroups/NSNGroupsUsersEmailSend.php
Line(s):26, 27 and 28
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©