Package: evolution-data-server
Version: 3.12.9~git20141128.5242b0-2+deb8u2
Severity: critical
Tags: patch
Justification: causes serious data loss

Hi there,

there is a serious bug in libcamel 3.12.3. This bug is not fixed in
3.12.11 and since 3.12.11 is the last upstream release of that
branch, it will not get fixed in any 3.12.x version ever.

It happens that you when send a mail in Evolution, the program reports no
error message at all and moves your mail to the Sent folder, whereas
the mail has not been sent at all! On the SMTP server side an error
like "SMTP connection lost while reading message data" is logged.
This happens especially with mails with attachments. The bug has been
identified upstream and is fixed in the 3.16 series, but not in 3.12 as
mentioned before:

https://bugzilla.gnome.org/show_bug.cgi?id=749292

The patch is simple and replaces a call to g_output_stream_write()
aith one to g_output_stream_write_all(). I have applied this patch to
a local copy I rebuilt of e-d-s and confirm that it fixes the issue
for me.

Since this issue caused silent loss of important data for me, I'd like
to ask for the patch to get applied to the 3.12 version in unstable
ASAP. Also, I believe this must definitely get applied to the version
in stable as well.

Thank you very much already,

 - Fabian


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'experimental'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages evolution-data-server depends on:
ii  evolution-data-server-common  3.12.9~git20141128.5242b0-2+deb8u2
ii  gnome-keyring                 3.16.0-2
ii  libc6                         2.19-18
ii  libcamel-1.2-49               3.12.9~git20141128.5242b0-2+deb8u2
ii  libdb5.3                      5.3.28-9
ii  libebackend-1.2-7             3.12.9~git20141128.5242b0-2+deb8u2
ii  libebook-1.2-14               3.12.9~git20141128.5242b0-2+deb8u2
ii  libebook-contacts-1.2-0       3.12.9~git20141128.5242b0-2+deb8u2
ii  libecal-1.2-16                3.12.9~git20141128.5242b0-2+deb8u2
ii  libedata-book-1.2-20          3.12.9~git20141128.5242b0-2+deb8u2
ii  libedata-cal-1.2-23           3.12.9~git20141128.5242b0-2+deb8u2
ii  libedataserver-1.2-18         3.12.9~git20141128.5242b0-2+deb8u2
ii  libgcr-base-3-1               3.14.0-2
ii  libgcr-ui-3-1                 3.14.0-2
ii  libgdata19                    0.16.1-1
ii  libglib2.0-0                  2.45.1-2
ii  libgoa-1.0-0b                 3.14.2-1
ii  libgtk-3-0                    3.14.5-1
ii  libgweather-3-6               3.16.1-1
ii  libical1a                     1.0-1.3
ii  libldap-2.4-2                 2.4.40+dfsg-1
ii  libpango-1.0-0                1.36.8-3
ii  libsecret-1-0                 0.18.2-1
ii  libsoup2.4-1                  2.48.0-1
ii  libxml2                       2.9.1+dfsg1-5

evolution-data-server recommends no packages.

Versions of packages evolution-data-server suggests:
ii  evolution                  3.12.9~git20141130.241663-1+b1
pn  evolution-data-server-dbg  <none>

-- no debconf information
>From bae0c643978a67f5368b6b0e5638b97687ee443a Mon Sep 17 00:00:00 2001
From: Milan Crha <mc...@redhat.com>
Date: Mon, 9 Feb 2015 12:58:09 +0100
Subject: Make camel_stream_write() try to write all bytes at once

The default implementation of CamelStream::write() used
g_output_stream_write() method, which could write only a partial
content, returning how many bytes had been actually written. That's
fine, but not each caller counted with this, thus for example
a CamelStreamFilter::write() failed when only partial buffer had
been written, which could cause a silent failure on message send.
Easier than taking care of the not-whole-buffer-written state
at each place of the usage is to use g_output_stream_write_all()
function instead, which fails only on errors.

This had been reported downstream as:
https://bugzilla.redhat.com/show_bug.cgi?id=1186815

diff --git a/camel/camel-stream.c b/camel/camel-stream.c
index a4270f5..980c70b 100644
--- a/camel/camel-stream.c
+++ b/camel/camel-stream.c
@@ -147,20 +147,25 @@ stream_write (CamelStream *stream,
               GError **error)
 {
 	GIOStream *base_stream;
-	gssize n_bytes_written = (gssize) n;
+	gssize n_bytes_written = -1;
 
 	base_stream = camel_stream_ref_base_stream (stream);
 
 	if (base_stream != NULL) {
 		GOutputStream *output_stream;
+		gsize n_written = 0;
 
 		output_stream = g_io_stream_get_output_stream (base_stream);
 		stream->eos = FALSE;
 
-		n_bytes_written = g_output_stream_write (
-			output_stream, buffer, n, cancellable, error);
+		if (g_output_stream_write_all (output_stream, buffer, n, &n_written, cancellable, error))
+			n_bytes_written = (gssize) n_written;
+		else
+			n_bytes_written = -1;
 
 		g_object_unref (base_stream);
+	} else {
+		g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot write with no base stream"));
 	}
 
 	return n_bytes_written;
-- 
cgit v0.10.2


Reply via email to