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

A.L.E.C alec at alec.pl
Wed Sep 8 09:55:58 CEST 2010

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

> 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.

Aleksander 'A.L.E.C' Machniak http://alec.pl gg:2275252
LAN Management System Developer http://lms.org.pl
Roundcube Webmail Developer http://roundcube.net
List info: http://lists.roundcube.net/dev/

More information about the Dev mailing list