A couple of weeks ago, one of Migadu's email clusters started malfunctioning. Apparently they had already planned to decommission it but had to accelerate their plans and migrate everything to a new cluster.

Once the migration was done, I tried refreshing mbsync only for aerc to tell me that the sync failed. I checked the logs and found an error message: Unable to recover from UIDVALIDITY change. According to the manpage, UIDs are "unique message identifiers" used by mbsync for synchronization. This means that the migration changed the UID of the remote messages and mbsync can't handle the discrepancy.

Considering that all messages were saved and available on the server, the solution was quite simple. Note the emphasis on the previous sentence: the following actions will delete all your local email, so depending on your circumstances this will not be the solution for you.

  • Delete the .uidvalidity file.
  • Delete the contents of the corresponding folder rm folder/*/*.
  • Delete the cached state found at ~/.mbsync/:remote_name:remote_box:local_name:local_box:.
  • Re-sync and watch how the mailboxes fill again.