Re: [PHP-DB] Re: [PHP] Re: [PHP-DB] Re: [PHP] Re: [PHP-DB] Re: [PHP] PHP EOL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



@Stuart
Ah, then you are right that they were not compliant. The code is not that old. Thank you so much for the links and information too. Much more than I expected. I did not know that they were sent OS-Independent, but that makes perfect sense.
Again, please excuse my lack of understanding.
My thought on why I would still use the code was that even though the SMTP server would not be OS specific, the email program or browser would be and that it would format
for the user depending on that program/browser and the OS it runs on.
IE: Thunderbird on PC or Mac Mail; viewing yahoo on Safari Mac or IE on PC.

Technically speaking, is it not possible to determine with a if {} to see which catches? This is probably not the best way to go about formating, just more for my intuit. With that code, I did not get any bounce backs or messages pertaining to ill formatting or "no send no show".
So it didn't seem to be a bad code. Thus I continued use.
But like what was said earlier in the thread, I agree PHP_EOL would be the best fit.

Thank you for all your input, help and resources.

Best,
Karl

On Jul 4, 2011, at 2:01 AM, Stuart Dallas wrote:

On Mon, Jul 4, 2011 at 7:11 AM, Karl DeSaulniers <karl@xxxxxxxxxxxxxxx>wrote:

Hello Stuart,
After some closer look at the RFC Compliant manuals you suggested,
I have determined that the creator of that code was in fact RFC821
Compliant.
Being that this was a code I found several years ago, RFC822 may not have
been in effect.
This being the reason (I believe) that the creator went with a check for
System OS when determining the end of line characters to use.
Not substantiated in any way, but that is what it looks like to me. I could
stand corrected.


RFC821: Simple Mail Transfer Protocol, dated August 1982 (
http://www.faqs.org/rfcs/rfc821.html)

RFC822: Standard for the Format of ARPA Internet Text Messages, dated August
13, 1982 (http://www.faqs.org/rfcs/rfc822.html)

So, unless you started using that code before PHP was created (1995 if we go
back as far as PHP/FI) then no, RFC822 predates that snippet of code.

Further, RFC821 defines the end of lines as CRLF, so the creator of that code was not RFC821 compliant if it was being used to send commands to an
SMTP server.

From RFC821, MAIL FROM command definition: MAIL <SP> FROM:<reverse- path>
<CRLF>

From RFC822, general header field definition: field = field-name ":" [
field-body ] CRLF

Note the CRLF at the end of both definitions.

Now, technically speaking the body of email messages can use any line
endings they want to, but the headers should use CRLF, and commands sent to
servers should also use CRLF.

One final thing for you to consider... what we've been talking about is commands and messages being sent to other computers, so what good does it do to send them in a format that's dependent on the OS of the sending machine? The standards exist so they are OS-independant, because you usually cannot
tell what OS the computer you're talking to is running.

-Stuart

--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux