During setup of Kopano in a Univention environment I ran into exactly the same problem when migrating the email data. Infact, it is several (but not all) paypal emails regarding changes in their general terms. These mails are very similar, but some break the database connection, others don’t. It does not matter if I try to import via IMAP (kopano-gateway) or Outlook MAPI (kopano-server) oder fetchmail (kopano-dagent), the problematic emails always break the database connection with server.log entry as described by Fux.
Kopano 188.8.131.52-0+33.2 (current under UCS)
UCS 4.3-0 errata9
Optimizing the database makes no difference. Changing character set of database from latin1 to utf8 does not help as well. Issue is affecting about 1% of my emails. All affected mails are quite large and have extensive html code in their body (i.e. Paypal emails, but after more investigation also other mails are affected).