Davmail can't manage big message
Brought to you by:
mguessan
Hi,
I had a problem using davmail with big message (about 20Mb of attachments).
The problem is that Davmail don't download that email and stop to download newer ones without prompting errors.
I tried to use different emails client (Thunderbird and Opera mail), but I get the same problem.
Any ideas?
Well, sending messages with 20MB attachments is always a bad idea..
Anyway, DavMail depends on EWS or WebDav, i.e. Exchange speed and settings. If IIS times out there is no way to get full message without changing server side settings
My advice would be to try to sync as close as possible to the server.
=>please try to get your message content with EWSEditor.
I know that is a bad idea a big message, but I received it. Sometimes happens.
I tried to get the message with EWSEditor: I downloaded the attachments quite fast, but downloading one at a time.
However, I saw one strange thing in Davmail: the message is about 20Mb. It identified correctly, but tries to download about 35MB!
This is the log, when I tried to download this big message:
As you can see from the log file, Davmail identifies a size of 19640Kb for this email, but tries to download 35663Kb. It does twice, without prompting errors.
After the second attempt, the icon in system tray remains orange and if I put the cursor over the icon is displayed "Downloaded 35663 KBytes from /ews/exchange.asmx", but nothing happens. The icon remains in this condition until I try to download again the email or I close Davmail.
I have attached the full log file, if could be useful.
Thank You.
19640KB is the binary size of the message, 35663KB is the size (computed by Exchange) after Base64 encoded. The only way to get full message content is with the IncludeMimeContent option of the GetItem call.
If your connection is fast enough you should be able to download full message from Exchange. In your log file the last message is about 1 minute after request start => maybe you have a 1 minute timeout somewhere.
This is the same as using Export Mime content in EWSEditor.
I successfully downloaded the full message using Export Mime content in EWSEditor.
I get an eml file of 26834Kb size.
I checked if there is 1 minute timeout somewhere, but I can't find it. All settings are more than 2 minutes and I tried to set more than 10 minutes timeouts in Thunderbird, but I can't download through Davmail.
I understood because there is two different size in log file, but why Davmail tries to download twice and doesn't prompt error?
I sent the same message to a gmail account and I can dowload the message using POP3.
Could it be a Davmail bug?
Thank You.
Just tried with Office365:
=> Fetch time: 187222 ms
It takes 3 minutes to download 38MB of message data
=> no problem to fetch this large message through DavMail.
Thank you for your test.
"tried with Office365" means you used Outlook 2016 through Davmail? I would know which email client you used in your test to make other tests myself.
I want understand if the problem is a Thunderbird setting or a server side setting. In the last case, obviously I can't solve the problem.
Thank you again.
I tried with Office365 as server (basically latest Exchange version), and first unit test (java code), then thunderbird to download the large message
I found what's wrong in my configuration.
I was using a modified version of Davmail and I forgot it.
I was tring to use Davmail in full portable mode using Java portable and I followed this thread https://sourceforge.net/p/davmail/discussion/644057/thread/0ec8bb64/
and the problem is there.
If I use the standard "davmail.exe" everythings works fine.
Did you have suggestions to obtain an exe file that use a Java Portable?
How did you build your davmail.exe? I suppose you didn't use launch4j, but another exe builder.
Thank you
Davmail is already portable: just use the -noinstall package.
davmail.exe is basically the winrun4j package with an embedded ini + icon, see
https://sourceforge.net/p/davmail/code/HEAD/tree/trunk/src/winrun4j/
Davmail is portable, but need Java preinstalled. I use it on usb key and sometimes I found a PC without Java and without admin rights.
However I solved. I read ini file and I found what's wrong: in your configuration is used -XmX512M option, in that code there is -XmX128M option.
I changed that value and now it's work.
Thank you very much for your help.
EDIT:
I tried to use this modified ini from your source code, and recompiled davmail.exe and it works as well!
I only added "vm.location=..\java\bin\client\jvm.dll" to use a local JRE.
Thank You again.
Last edit: Alewaste 2017-02-19
Hi there,
we're having a similar issue here...
I, too, know that sending big attachments is always a bad idea but our employees need to send and receive them. We found that Davmail cannot send mails once they are bigger than approx. 25 MB. We've already tried various settings in the configuration file and also increased the heap size in Java to up to 4 GB, but unfortunately, the issue still persists.
Here's what we see in the log:
The last log entry contains an error message in German. The English translation should be something like: "davmail.exchange.ews.EWSMethod - The size of the request is too big. Decrease the size of the request and try again."
We have a German version of Microsoft Exchange 2010 and it seems that this error message was sent by the Exchange server. At first we thought that the issue is caused by Exchange, but in the meantime we don't think that's an Exchange issue. We already have increased all the size limits on the Exchange server so that it's not very likely that the issue is on the Exchange server side.
Also, at the same time when we see above log entries, we also see the following output on stderr:
Is this behaviour already known or do you know why this occurs?
Is there a way to successfully send such mails?
Could you please fix this issue?
Best regards,
Thomas
Last edit: Thomas Schachtner 2017-02-28
"Die Anforderung ist zu groß" is definitely not a DavMail message => it's sent by IIS Exchange frontend that does not accept such big message.
If you can manage your Exchange server the best option is probably to just enable standard SMTP listener instead of using DavMail.
Hi Mickael,
thanks for your answer. I'm not sure about the root cause of this error message. As you wrote, it could be Exchange, indeed. (That the German error message comes from Exchange is quite clear. I fully agree. But is that error message the one that causes DavMail to crash in the next step or is it just the other way around: DavMail crashes first and is doing something that makes Exchange throw that message?)
When sending this mail using the OWA web frontend, sending that mail is working just fine. I've set all the limits on the Exchange server to at least 100 MB. So in my opinion, Exchange should not reject that message. (But of course: who knows...)
In addition to that error message, there's also a crash od DavMail due to a lack of Java heap space. Even when increasing the heap space for DavMail to 4 GB, the same error message is shown. This is quite strange for me.
As to your suggestion to use the standard SMTP listener (which is already enabled) instead of DavMail: We used to work with the standard SMTP listener until some time ago when our users found out that their business application does not place their sent mails into Exchange's "Sent" folder. Unfortunately, the 3rd party application does not allow to place sent items into the Sent folder, so we needed to work with some workaround. We were so happy when we saw that DavMail is offering exactly that feature and started evaluating and then using DavMail immediately.
We are still fond of DavMail but we (unfortunately) sometimes need to send quite big mails. It would be great if we could do that with DavMail.
Thanks,
Tom
Not much more I can do, except if an expert Exchange admin tells us how to improve this.