I'm surprised the recent KMail problem has not been solved. The symptoms in my case, in brief, are
1. I am using KMail on my laptop with dovecot/IMAP to read mail collected on my desktop;
2. KMail crashes when reading, or even accessing, certain messages. These are nearly all, if not all, mailing list digests. I guess the property they have in common might be that they have a large number of references to other messages or URLs.
I submitted a bugzilla, which bizarrely to me was declared a duplicate of a bugzilla over a year old https://bugs.kde.org/show_bug.cgi?id=186502 and which appeared to deal with another symptom, KMail crashing when it starts.
There are a large number of duplicates listed, nearly all very recent.
It seems to me fairly obvious that the problem has arisen recently, and is due to a recent change in KMail (or possibly dovecot).