Is it safe to take the POSTed value from a <textarea> field and strip out all the CRLF's and replace them with line feeds ONLY, if it's going to be used in a message body?
Here's the problem:
I'm sending mail from two servers: both servers are virtually identical. In fact, one is the staging server, and the other is the live server, so Apache and PHP versions, the config files etc. are all in sync.
When I send mail from the staging server to any of my email accounts (Yahoo, home - Outlook POP on a Linux server, work - Outlook Exchange on Windows server) it looks fine.
When I send mail from the live server, to my work account, all of the line breaks are doubled, so there's lots of white space in my message.
I can fix this problem if I search and replace CRLF (\r\n) with line feeds only (\n) in the message body before sending it out.
Is it safe to do this in general for all platforms?
-Antun