« Top 5 2007 Excellence.Gov awardees honored | Main | Grants Policy Committee webcast - March 8, 1.30pm-3.30pm »

Dovecot Invalid Messageset Error and Solution

Though working for a long time, while trying to read their mail, two of our Thunderbird IMAP users suddenly received the error: "The current command did not succeed.  The mail server responded: Invalid messageset: -2147483648:*."

A bit of research revealed that Dovecot versions 0.99.13 and earlier have an interesting bug in which the X-UID header for emails can get too large, and therefore cannot be processed by Dovecot.  (Information can be found here (translated from Japanese) and here).

Unfortunately, to fix this (in my case under Fedora Core), you have to do some work for every user who encountered the error:

  1. Turn off sendmail and dovecot.  In my case:
    • /etc/init.d/MailScanner stop
    • /etc/init.d/dovecot stop
  2. For every user experiencing the problem (say jdoe), remove the offending X-UID lines from the email and reset their imap indices:
    • grep -v '^X-UID: ' jdoe > jdoe2
    • grep -v "^X-IMAPbase: " jdoe2 > jdoe
      • Note: this step was missing from the other online articles
    • rm jdoe2
    • chown jdoe:mail jdoe
    • chmod 660 jdoe
    • rm ~jdoe/mail/.imap/.imap.index*
  3. Then restart dovecot and the mail server.  In my case:
    • /etc/init.d/MailScanner start
    • /etc/init.d/dovecot start

The next time the user hits their INBOX through IMAP, unfortunately Thunderbird will need to reload all of the messages, but at least it will work again.

Aparently upgrading Dovecot to 0.99.14 or later will avoid the issue in the future.

Hope this helps.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83451754b69e200d83574f4cf69e2

Listed below are links to weblogs that reference Dovecot Invalid Messageset Error and Solution:

Comments

didnt work for me.. :( where do you run these commands?

# grep -v '^X-UID: ' jdoe > jdoe2
# grep -v "^X-IMAPbase: " jdoe2 > jdoe

thanks...

tom

This worked perfectly! Made me look like a hero to our CEO on a Saturday while he was waiting for an important email on a business trip! You rock!

Thanks
DT

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment