Well, finally the errors are discovered. There were format errors in the mailbox. Lots of messages does contain special characters in the message header which should not be there.
Example:
Code:
From name@domain.com^M Sat Jan 3 01:05:34 1996
Several of messages in lots of mailboxes contains the HEX 0x0d character. This caused the imapd in Slackware crash sometimes with segfault. I still try to reproduce the segfault state but I don't know which operations on this mails caused the segfault.
I noted that the segfault state was preceded by Use Hang logs in imap. After some of these hangs the crash happend.
The error was discovered with help of Dovecot. I changed the imap daemon in Slackware and I get more accurate error messages about this crashes. In one moment Dovecot showed the message (with one mailbox) that it cannot open the mailbox because it is not a proper mbox file. After this I examined this mbox file. I cut the mbox into separated message files.
Code:
csplit -n 4 -k mbox '/^From /' '{*}'
This produced header files and message body files. First I did not noticed the 0x0d character in the From line. But when I discovered it I deleted the character, rebuilt the mbox and I could access the mailbox again.
I expected that this character get into the mbox file by mistake. But finally I found out that in another mbox there was plenty of errors like this. All the messages was sent by blackberry smartphone.