After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682449 - Cannot send mail with large message body
Cannot send mail with large message body
Status: RESOLVED NOTGNOME
Product: evolution-mapi
Classification: Applications
Component: Mail
3.4.x
Other Linux
: Normal critical
: ---
Assigned To: evolution-mapi-maint
evolution-mapi-maint
: 684835 687179 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-08-22 10:48 UTC by Holger Weiss
Modified: 2012-10-31 16:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libmapi logfile (859.07 KB, text/plain)
2012-08-22 11:44 UTC, Holger Weiss
  Details
oc patch (7.22 KB, patch)
2012-10-26 11:44 UTC, Milan Crha
none Details | Review

Description Holger Weiss 2012-08-22 10:48:42 UTC
I am using Debian Testing/Wheezy with evolution, evolution-common, evolution-data-server 3.4.3-1 and evolution-mapi 3.4.3-1.

We changed our MSExchange Server from Exchange2003 to Exchange2010.
I can receive Emails and the calendar is updated.
I get the message:

"WriteStream: MAPI-Fehler MAPI_E_CALL_FAILED (0x80004005)"

when I send emails bigger than 923 letters. 
I do not see the problem when sending via our MS-web-account (OWA) or using MS-Outlook (same mailbos-account and login etc.)

The problem does not exist on my colleagues Ubuntu Evolution version 3.2.x.
He is able to send big emails on the same server.

It look like a problem with libmapi or evolution-mapi when emails get bigger than approx. 2kByte.

Attached is a lipmapi debug-logfile (LIBMAPI_DEBUG=15) while trying to send a email with more than 923 letters.

How can I solve this problem ?
Comment 1 Holger Weiss 2012-08-22 11:44:37 UTC
Created attachment 222131 [details]
libmapi logfile
Comment 2 Milan Crha 2012-08-23 15:33:34 UTC
Thanks for a bug report. This should be fixed by this commit [1], which is part of 3.4.4 release. I suggest, rather than "just" backport this particular fix, update to 3.4.4, which contains more fixes than this one.

Could you verify that the commit [1] fixes the issue for you, please?

[1] http://git.gnome.org/browse/evolution-mapi/commit/?h=gnome-3-4&id=f051f13e2f64c3900bbbb8e10179b777223847a8
Comment 3 Holger Weiss 2012-08-24 06:32:38 UTC
(In reply to comment #2)
> Thanks for a bug report. This should be fixed by this commit [1], which is part
> of 3.4.4 release. I suggest, rather than "just" backport this particular fix,
> update to 3.4.4, which contains more fixes than this one.
> 
> Could you verify that the commit [1] fixes the issue for you, please?
> 
> [1]
> http://git.gnome.org/browse/evolution-mapi/commit/?h=gnome-3-4&id=f051f13e2f64c3900bbbb8e10179b777223847a8

Thanks for your response and I would like to apply your proposal, but as I am not a debug/ source-compiling super-hero, I would need some help for doing that !

I guess I should take the 3.4.4 source from the gnome-website for evolution-mapi and compile is on my system, install the dpkg and try it out ?

Or should I rather use the 3.4.3 source from the debian repos for evolution-mapi and apply the changes for 3.4.4 (this is something I do not know how to do) !

Can you support me in doing that - or send me the link to an howto ?

Thanks
Comment 4 Milan Crha 2012-08-24 07:02:31 UTC
Hmm, I do not know how Debian works with package compiling, I do not use it, but the easiest way would be to get the commit as a patch and apply it to 3.4.3. The thing is that 3.4.4 requires evolution-data-server-3.4.4, same as evolution-3.4.4, which is better for getting other changes and so on, but harder due to 3 package compilation. I guess you can find some how-to for Debian package compilation with Google. Alternatively you can try to contact the Debian package maintainer, whether he/she is not willing to update packages to 3.4.4 for everyone. I'm sorry for not being of help here.
Comment 5 Holger Weiss 2012-08-24 08:21:01 UTC
(In reply to comment #4)
> Hmm, I do not know how Debian works with package compiling, I do not use it,
> but the easiest way would be to get the commit as a patch and apply it to
> 3.4.3. The thing is that 3.4.4 requires evolution-data-server-3.4.4, same as
> evolution-3.4.4, which is better for getting other changes and so on, but
> harder due to 3 package compilation. I guess you can find some how-to for
> Debian package compilation with Google. Alternatively you can try to contact
> the Debian package maintainer, whether he/she is not willing to update packages
> to 3.4.4 for everyone. I'm sorry for not being of help here.

Hi,
I managed to insert your recommended patch into the debian source of 3.4.3 and compiled it successfully. But the problem remains !

I am going to add the other patches to the 3.4.3 source and test them.
Do you have links to other patches for me, which I can try ?

Bthw. I tested my Exchange account with my colleagues evolution version (evolution-mapi 3.2.2-1) and was able to send big emails.

Thanks !
Comment 6 Milan Crha 2012-08-24 13:03:17 UTC
You can see here [1] all the commits being used in 3.4.4. by clicking on each name a patch will be shown. Use only those between EVOLUTION_MAPI_3_4_3 and EVOLUTION_MAPI_3_4_4, but do _not_ use "Post-release version bump". Apply them in that order (by date).

> Bthw. I tested my Exchange account with my colleagues evolution version
> (evolution-mapi 3.2.2-1) and was able to send big emails.

Yes, it makes sense. I did significant changes in internals of evolution-mapi, and this particular bug slipped between my fingers, unfortunately.

[1] http://git.gnome.org/browse/evolution-mapi/log/?h=gnome-3-4
Comment 7 Holger Weiss 2012-08-24 14:44:32 UTC
(In reply to comment #6)
> You can see here [1] all the commits being used in 3.4.4. by clicking on each
> name a patch will be shown. Use only those between EVOLUTION_MAPI_3_4_3 and
> EVOLUTION_MAPI_3_4_4, but do _not_ use "Post-release version bump". Apply them
> in that order (by date).
> [1] http://git.gnome.org/browse/evolution-mapi/log/?h=gnome-3-4

I applied all the patches for 3.4.3 from the link and compiled successfully.
I (once again) did purge the "evolution-mapi" and "libexchangemapi" package and installed my own compiled versions, but the error still remains.
Seems no patch did solve the problem.

As this is a very important bug for me (cannot send attachements or long text), what can I do next to support the debugging ?

Are some more logs or debug or patches possible, which may help to identify the bug ?
Comment 8 Holger Weiss 2012-08-24 14:52:52 UTC
Can you confirm the bug on your system, or can someone else confirm this bug ?
(MS Exchange Server 2010 required with MAPI interface).
Comment 9 Milan Crha 2012-08-27 08:09:57 UTC
This is interesting. I swear I tested the change from comment #2 and it worked, nonetheless, I cannot send a message with large text/plain body. It fails in the same way here.
Comment 10 Milan Crha 2012-08-27 09:55:03 UTC
I see in your log that this fails the same way as on my machine, with
> rpc fault: WERR_RPC_X_BAD_STUB_DATA
It seems like the request is malformed on the RPC level.
Comment 11 Holger Weiss 2012-08-27 11:15:20 UTC
Thanks for confirmation of the bug !

The size of a "successfull" sent email is limited to 923 characters in my case. A email with 924 characters or more fails. 
What does cause this hard limit (where does it come from) ?

Maybe this is one direction to search for the bug.
If I can help you identifying the bug by logs or tests within evolution + exchange 2010 , please let me know !
Comment 12 Milan Crha 2012-08-27 13:17:59 UTC
The message body is encoded into Unicode, thus basically two bytes per letter, and evolution-mapi uses its own limit for when to use streams for properties. Maximum size of all properties for SetProps is about 4KB and evolution-mapi tries to be on a safe side here.

I tried to reproduce this with openchangeclient, and it fails in the same way, even it pretends success. I wrote to the OpenChange devel list [1], maybe they will know what could break. Either way, this error comes from some lower library, either from OpenChange's libmapi, or from something from samba4. I'll update this bug as soon as I'll know anything new.

There is currently no workaround, except of trying evolution-ews, which has lighter dependencies too. (I do not count "write smaller emails" as a workaround, because when it comes to attachments...).

[1] http://mailman.openchange.org/pipermail/devel/2012-August/005483.html
Comment 13 Milan Crha 2012-08-27 13:19:06 UTC
(I'm lowering the severity, because it's out of evolution-mapi hands.)
Comment 14 Holger Weiss 2012-08-27 14:35:11 UTC
(In reply to comment #13)
> (I'm lowering the severity, because it's out of evolution-mapi hands.)

I am fine with that - and I hope the openchange gyus are reacting to this bug as fast as you did !

Thanks!
Comment 15 Holger Weiss 2012-10-05 13:22:35 UTC
Today, my colleague updated to Ubuntu 2.10 with Evolution 3.6 and got the same issue with the large body message as I do. Some more need to follow ....

The bug makes us stuck here and we are in big trouble, we are forced to use MS tools to send emails for the future if no solution is provided !

Milan, do you have an idea, how we can get intouch with the openchange guys, or how we can make them to create a quick bugfix or work-around ?

Are you in contact with the openchange-team ?

Do you know when a update will/can be available ?
Comment 16 Holger Weiss 2012-10-05 13:27:35 UTC
I checked the openchange bug tracking list, but it seems the but from your link in comment 12 is not listed in the buglist.

Can you please verify this ?

Link:

http://tracker.openchange.org/projects/openchange/issues?set_filter=1&tracker_id=1
Comment 17 Milan Crha 2012-10-19 08:47:41 UTC
I sent them only an email, in a hope to get quicker response than through the tracker, but I didn't receive any reply from them yet. You can write to
   devel [at] lists.openchange.org
and ask them directly, it's basically the way I talk to them (apart of IRC, but I use to miss Julien these days).
Comment 18 Milan Crha 2012-10-22 07:34:30 UTC
*** Bug 684835 has been marked as a duplicate of this bug. ***
Comment 19 Milan Crha 2012-10-25 16:41:20 UTC
I sent update to the openchange's devel list:

I made more tests today and it turned out that the problem is elsewhere, in samba4. I built OpenChange 1.0 against samba4-alpha16 and I can send long emails there, same as with alpha17, but if I use alpha18 or any later version of samba4, including beta8, then the WriteStream fails.

I compared raw bytes being sent to the server, and the wrong samba4 sends on byte more than the working samba4. The three bytes for the request (opnum, logon_id, handle_idx) are written as expected, then is written one byte more, a 0, then the rest continues as expected (the stream data).

I asked for help samba folks, thus we'll see whether they'll fix this in beta9 or any later version.
Comment 20 Milan Crha 2012-10-26 11:44:40 UTC
Created attachment 227351 [details] [review]
oc patch

for OpenChange;

I sent the patch to OpenChange's devel list too, but to have it handy I add it here as well. The devel list thread has some explanation what was going on.

I'm also building Fedora updates for 17 and 18, with the patch included. They will be part of updates-testing in few days.
Comment 21 Holger Weiss 2012-10-29 12:57:46 UTC
Hi Milan,
great support! 

I would like to test the patch immediately, but I am stuck with the question: Which source packages do I need to patch and compile ?

Is it the "libexchangemapi" or "samba4" or ???

Can you please send me the packages I have to patch and rebuild?

To what package does this exchange.idl belong to ? 

Thanks!
Comment 22 Milan Crha 2012-10-29 16:16:30 UTC
It is the openchange package. I just had a chat with Kerihuel, the coder of OpenChange, and he told me that he'll do a different change in OpenChange, as there might be more places affected by this change in samba4. Nonetheless, I have OpenChange package patched and built already, at least for Fedora. In case you use it (I'm not sure from the above text if you do), then feel free to pick them from these updates:
   Fedora 17: https://admin.fedoraproject.org/updates/FEDORA-2012-17045
   Fedora 18: https://admin.fedoraproject.org/updates/FEDORA-2012-16891
I cannot help with other distribution, though.
Comment 23 Milan Crha 2012-10-30 13:12:30 UTC
*** Bug 687179 has been marked as a duplicate of this bug. ***
Comment 24 Arpad Bakay 2012-10-30 21:37:16 UTC
I confirm Milan's openchange/libmapi patch of 2012-10-26 11:44:40 WORKS FINE!

Thanks!
Comment 25 Tino Keitel 2012-10-31 08:07:39 UTC
I just built a new libmapi package for Debian Sid with the same patch and I can send large mails again.
Comment 26 Holger Weiss 2012-10-31 15:58:14 UTC
I also can confirm the patch (Debian Testing/Unstable) for the libmapi0 package!

Works!
Comment 27 Milan Crha 2012-10-31 16:38:59 UTC
Thank you all for testing. I'm sorry it took so long, I was lost in libmapi/samba4, thus it took me longer than needed/expected.