[RCD] line endings in .eml files exported from RC

Phil Weir roundcube at tehinterweb.co.uk
Thu Sep 9 11:25:03 CEST 2010

On Wed, 08 Sep 2010 09:55:58 +0200, "A.L.E.C" <alec at alec.pl> wrote:
> On 08.09.2010 09:37, Phil Weir wrote:
>> I can open the file before importing it and change the line endings but I am
>> wondering if I have missing something and there is a more elegant way of
>> doing it, does anyone have any suggestions?
> You need to make replacement before using rcube_imap_generic's
> appendFromFile(). You could use append() instead, but not for really big
> messages.
>> At the moment I am using this code:
>> // check message has correct line endings
>> $message = file_get_contents($file);
>> $message = preg_replace('/\r?\n/', $rcmail->config->header_delimiter(),
>> $message);
> Don't use header_delimiter() method. It should be used only for sending
> mail with mail() function. For SMTP/IMAP standard (\r\n) delimiter
> should be used always.

That works great Alec, thanks very much for your help.

List info: http://lists.roundcube.net/dev/

More information about the Dev mailing list