I do not think this problem is a local one. The text size that actually causes the error is 1078 characters. I am running a loop and inserting the whole mailbox with about 400 messages into a database. At a specific number, in this case it is 97, the loop stops by producing the error. I can delete that message from the mailbox but than it is the next message that causes the error.
I just tried your suggestion, to see what comes out, and set the length to a higher value. But, as expected, this did not help. I think there is a limit to the whole database. Do you have information about that?