2006/3/8, Thomas -Balu- Walter <[EMAIL PROTECTED]>: > If I recall correctly there were some issues regarding line endings in > headers, etc. a while ago. After that a new option was added: > > // this string is used as a delimiter for message headers when sending > $rcmail_config['mail_header_delimiter'] = "\r\n"; > > I just stumbled over an explanation why there is a need for different > line endings (not sure if that was clarified yet). > > The problem is that the behavior of mail() is different on Windows and > Unix systems. On Windows mail() connects to an SMTP server to send, > while on Unix it usually uses a local command which then forwards the > mail to the MTA of the system. > > The result is that on Windows you need to use the line endings defined > in the mail specification for headers and body: "\r\n" > > Some MTAs will get a little confused when you use only "\n" on a Windows > system. Especially good old friend qmail is very picky and will simply > refuse mails without the needed \r. > > On Unix the MTA usually uses a "sendmail interface" which assumes that > it receives Unix line endings (\n) and will change them to "\r\n". So > using a "\r\n" in this case will result in "\r\r\n" which of course is > wrong. Instead we only need to use "\n" in mail(). > > Does anyone know how Macs send mail() (afaik they only use \r as line > endings)? > > Perhaps we can add some kind of autodetection with this info (but let > the user override it if he has a special setup)? > > Balu >
I'm not a skilled programmer .. but I guess IF autodetection would be implemented .. it should be a 'run once' - event. Since PHP is a scripting language .. we don't want to be autodetected every time the mail() function is invoked (=overhead). So i guess there should be set an 'on-first-run-only' variable in some database or text-file ?
