It's a bit easy to put this on TB since it doesn't do any of these things on regular imap connections. And it also doesn't explain why davmail starts multiple threads with downloads of the same message. This last one appears to be triggered when other activity occurs. Like Thunderbird updating the message list. This helped me reduce the problem by putting an unused map active in TB when it downloads large messages. Keep alive was always on, so that isn't a problem.
Had a wonderful day yesterday with 5.3.1 as well. After getting back in the office with four > 10 MB messages in my mailbox I had a hell of a time getting them in. It's basically a process of selecting an unused folder in Thunderbird. Then letting everything download with the occasional restart of davmail and tb when it blows up. Took me six or seven restarts and several hours before everything was finally in. Something is seriously bugged in davmail.
I'd just like to mention that this problem still exists in 5.2.0. Davmail is still starting multiple downloads of the same message on slow connections.
Just wanted to add that it happened in the inbox today as well. The "workaround" is easy enough though. Simply don't touch Thunderbird until it completes downloading the message. As long as it does not send another task in the direction of davmail while it is downloading, everything completes normally and the local cache will prevent any further problems.
Now with Keep Alive an I sent another larger mail (3MB, so not that big, but the connection to the Exchange server is still pretty slow) and the same thing happened. Note that after restarting both Thunderbird and Davmail I just let it download without touching anything. This made it finish properly. I did end up with two copies of the mail in my sent box. It seems that Davmail runs into problems if other things happen while the message is being downloaded. So it should not be hard to reproduce if...
Now with Keep Alive an I sent another larger mail (3MB, so not that big, but the connection to the Exchange server is still pretty slow) and the same thing happened.
That option was still off. I don't see any evidence of timeouts in the logs though, but I don't know if that is logged.
Endless message download loop