LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-23-2011, 11:46 AM   #1
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Rep: Reputation: 78
Check mailbox for errors


Hi
I need to check my mailboxes for errors.
My imapd has permanent errors, it periodically crashes. I think that the problem will be with some errors which was created when I converted my previous maildirs to mailboxes.

It is possible to check the integrity of these mailboxes with some command or script??

Thanks in advance for your responses

Last edited by hua; 08-02-2011 at 01:46 AM.
 
Old 08-02-2011, 01:45 AM   #2
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Original Poster
Rep: Reputation: 78
Have some results.
Maybe it helps to someone who experiences the same problem with imapd on Slackware.
The MUA is Thunderbird (previous-v.3.1.10 now-v.5.0) - finally it was the source of the problems. (Note I am not the administrator of those PCs, we use SSL)

Since my users have lots of huge mailboxes (1-4 GB) we was synchronize those mailboxes on Thunderbird. (It downloads the boxes to the local PC)
Somehow the Thunderbird gets into zombie state on the client desktops (MS) when the Thunderbird was closed. It stays in the process list and generate a huge traffic. I don't know, maybe a virus or corrupted Thunderbird (corrupted local mailbox??) ... but finally the complete uninstall of Thunderbird (also with deletion of the garbage left behind the installer - the downloaded mboxes, profiles, cache) solved the problem.

I keep the thread updated with the results of the long-term testing. (Note the actual state was - every-day crash of imapd)
 
Old 10-17-2011, 09:53 AM   #3
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Original Poster
Rep: Reputation: 78
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.

Last edited by hua; 10-17-2011 at 09:57 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] CyrusIMAP: How can one move mailbox subfolders to another mailbox, serverside? promostage Linux - Software 1 05-27-2011 04:22 AM
yum update transaction check errors & mirror errors tonycunn Linux - Software 2 11-29-2010 08:16 AM
check for Buffer I/O Errors cccc Linux - Software 4 09-05-2010 12:22 PM
How to check if user has mailbox ? dlugasx Linux - Server 1 11-13-2009 01:01 AM
Tripwire --check errors..what to do? ir0nmdn Linux - Security 3 10-20-2005 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration