Dovecot modseq_hdr.log_offset too large (Plesk)

Another quick fix post!


A mailbox for a specific user was not receiving mail on a postfix & dovecot on a Plesk server which I managed. The following error messages were being shown in the mail log:

$ tail -f /var/log/maillog
Apr 25 15:04:34 server01 dovecot: service=imap,,
ip=[]. Error:
modseq_hdr.log_offset too large

As you can see the the error is: “modseq_hdr.log_offset too large”.

I’m not sure what caused this (I think it’s related to the dovecot.index file becoming corrupted – but not 100% sure), but this quick solution fixed it.


To fix this, delete all dovecot files (config and index files) from the specific users mail directory:

$ find /var/qmail/mailnames/ -name "dovecot*" -delete

Restart Postfix & Dovecot (to rebuild the dovecot files):

$ service dovecot restart
$ service postfix restart

Warning: This fix removes the dovecot configuration and index files for that specific user. Make sure you back them up before running the above command! You may wish to restore them at a later date.

By magic the mailbox began to receive email!

6 thoughts on “Dovecot modseq_hdr.log_offset too large (Plesk)

  1. Dear Daniel, can you please elaborate on how to back up the dovecot configuration and index files and reinstate them , I am also having this exact problem with one mailbox on a company mail server, all the others work fine and your post seems all I can find about this issue

    1. Alex,

      As you would be removing the dovecot config and index files. You would need to create a copy of them. For example:
      cp /var/qmail/mailnames/ /backup/dovecot_backups/

      In the event that removing the dovecot config and index doesn’t fix your issue, you may wish to restore the files back by moving them back into the /var/qmail/mailnames/ directory from your backups and restarting dovecot and postfix.

      I’d strongly recommend backing up the entire mail server anyway just incase you mistype the command or some other rare event takes place – this is good practice. However as you are only removing the config and index files for that one user (which dovecot will automatically rebuild when it starts) I suspect no issues should occur.

      I hope you manage to resolve your issue.

  2. Thank you, worked fine , initially client said he lost 4 months mails, after deleting Imap account on Outlook and re-creating account, all his mail are now back and I don’t see errors in the mail log anymore

Leave a Reply