Gossamer Forum
Home : General : Internet Technologies :

postfix and CRLF

Quote Reply
postfix and CRLF
Hi guys,

I am running postfix and I hit a few roadblocks with the way emails are displyed. The bottom line is that I needed to modify a few cgi and php scripts the way that they send

\n as CRLF

instead of \r\n as CRLF, which is I think standard. Does anyone know how to change that in postfix, so that I don't have to modify all my scripts?

Cheers

Stuart
Quote Reply
Re: [vacationrentals] postfix and CRLF In reply to
Hi. The normal way to get rid of this (in the scripts themselves), would be something like;

$var =~ s/\n$//;
$var =~ s/\r$//;

...or possibly;

$var =~ s/\n\r$//;

The amount of times a \r\n sneaking in on my data import scripts/plugins has cost me hours of debugging time, is unbelievable :(

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] postfix and CRLF In reply to
Code:
$var =~ s/\n\r$//;


You have that back to front :)

Code:
$var =~ s/\r?\n//sg;


Note you will need the sg if you want to parse a string globally.
Quote Reply
Re: [B::Parse] postfix and CRLF In reply to
Quote:
You have that back to front :)

Whoops Blush

Quote:
Note you will need the sg if you want to parse a string globally.

Yeah, I left that out (forgot it was going to potentially have data passed to it, which will have multiple line/form feeds).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!