Fixing corrupt mailboxes

From OCF Help

Jump to: navigation, search

Occasionally some users find that their mailboxes have become corrupted, or more rarely, have disappeared completely (i.e., no messages in the mailbox at all). Sometimes, the corruption happens because the mailbox was being accessed from two different locations (for example, a desktop computer at home on DSL or cable connection with an IMAP email client running, while the user accesses it via webmail on campus) at the same time, and because of some bug in the IMAP server, the mailbox wasn't locked (so that the two clients won't try to modify the mailbox at the same time) properly. Other times, well, we don't know what's happening exactly. ;)

This page explains what to do if one of the above happens to you.

Fixing a corrupt mailbox

Typically, the inbox is the mailbox that gets corrupted. If you are familiar with text editors (if you are not, "nano" is a good editor for beginners, with most user-friendly interface), then log in via SSH, start up your favorite text editor, and open the file /var/mail/username, where username is your OCF username. Inside that file, delete everything until the first line that looks something like

 From foo@bar.com  Tue Aug 26 19:16:37 2003

Of course, the address and date may be different. A line like this must be the first line in your inbox file. You may want to save whatever text you deleted, for future reference. Then save the inbox file and try checking your mail again to see if the mailbox is still reported to be corrupted. If you believe some important messages may be corrupted, then also see the section below.

If you do not feel comfortable editing your mailbox file yourself, you may request that OCF staff do it for you (see our contact info). However, note that the staff member handling your request may inadvertently see some of the mailbox contents while editing it. If you are not comfortable with this either, then you should really learn how to use a text editor.

Fixing a disappearing mailbox

In some cases, your mailbox may be gone because you have inadvertently deleted it permanently, or perhaps just deleted all the messages to a trash folder or something. So, you may want to first try checking your trash folder. If you think that neither of these is the case, then your mail is pretty much not directly recoverable. However, the OCF does keep daily backups of all user inboxes (inboxes only, not your other mail folders). These backups are taken sometime between 3:30am and 6:30am, and are kept for about 4 days, so if you want to retrieve a backup, send in your request ASAP. Note that any mail that arrived after a given backup will not appear in that backup. Contact OCF staff (contact info) to retrieve an inbox backup.

Personal tools