[evolution-data-server/gnome-3-16] Revert "Bug 700814 - [IMAPx] Do not convert LF into CRLF on message APPEND"



commit 26fb6d029bcef3eb831418557a9cc4deb00bd617
Author: Milan Crha <mcrha redhat com>
Date:   Tue Apr 21 14:30:18 2015 +0200

    Revert "Bug 700814 - [IMAPx] Do not convert LF into CRLF on message APPEND"
    
    This reverts commit 96b092ea2ae04f8b12af59bacd45b8a1489f3cd9.
    
    Cyrus server claims an error "Message contains bare newlines" on append
    without this conversion.

 camel/providers/imapx/camel-imapx-server.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index c3ba60f..278e995 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -8634,10 +8634,12 @@ camel_imapx_server_append_message (CamelIMAPXServer *is,
                                    GError **error)
 {
        gchar *uid = NULL, *path = NULL;
+       CamelMimeFilter *filter;
        CamelIMAPXJob *job;
        CamelMessageInfo *info;
        GIOStream *base_stream;
        GOutputStream *output_stream;
+       GOutputStream *filter_stream;
        AppendMessageData *data;
        gint res;
        time_t date_time;
@@ -8673,12 +8675,19 @@ camel_imapx_server_append_message (CamelIMAPXServer *is,
        }
 
        output_stream = g_io_stream_get_output_stream (base_stream);
+       filter = camel_mime_filter_canon_new (CAMEL_MIME_FILTER_CANON_CRLF);
+       filter_stream = camel_filter_output_stream_new (output_stream, filter);
+
+       g_filter_output_stream_set_close_base_stream (
+               G_FILTER_OUTPUT_STREAM (filter_stream), FALSE);
 
        res = camel_data_wrapper_write_to_output_stream_sync (
                CAMEL_DATA_WRAPPER (message),
-               output_stream, cancellable, error);
+               filter_stream, cancellable, error);
 
        g_object_unref (base_stream);
+       g_object_unref (filter_stream);
+       g_object_unref (filter);
 
        if (res == -1) {
                g_prefix_error (error, _("Cannot create spool file: "));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]