5

I'm using emacs 24.5.1 on OSX with mu4e and mbsync. I'm synchronising with my imac and laptop so maybe it's the same error as mentioned here, but no one has posted a solution.

My specific error is that during the sync I'm receiving the following:

mbsync error: UID is 3 beyond highest assigned UID 1
mbsync error: UID is 7 beyond highest assigned UID 6

Any ideas on what's causing this and how to solve it?

rev
  • 623
  • 1
  • 7
  • 16

4 Answers4

3

In yourMaildir/INBOX/cur folder (or Maildir/otherfolder/cur), there'll be a file named something like 1568901502.26338_1.hostname,U=3:2,S. You can strip off everything from the ,U= from that filename and resync and it should be fine, e.g.

mv '1568901502.26338_1.hostname,U=3:2,S' '1568901502.26338_1.hostname'

This also solves the duplicate UID error. See http://tiborsimko.org/mbsync-duplicate-uid.html for more info.

This has worked for me – but since mbsync doesn't do it automatically there may be some good reason, so take a backup before you try :)

unhammer
  • 4,306
  • 2
  • 39
  • 52
3

I was able to fix this by editing the .uidvalidity file in the folder(s) in question; the second line is the maximum value U= filename. So I just changed this to match and it synced perfectly.

EkriirkE
  • 2,277
  • 19
  • 13
  • This didn work for me. The assigned UID kept always behind one integer. – nunop Dec 07 '20 at 09:09
  • Of course, because there may be several emails with `UID`s exceeding the maximum defined in `.uidvalidity`. `mbsync` bails at the first one it encounters. One way to quickly find the highest existing `UID`: `find /path/to/maildir/ | awk -F, '{print $2}' | tail -n1`. Match this with the second line of `.uidvalidity`. – bp99 May 23 '21 at 20:50
1

Try this:

(setq mu4e-change-filenames-when-moving t)

If that doesn't work, you can do what I did and start over by creating a new mu4e Mail folder and resyncing everything. Your messages will just download to the new folder with new UID's.

incandescentman
  • 6,168
  • 3
  • 46
  • 86
1

I had a similar issue with a quite big inbox with lots of nested folders. I wanted to go for the solution @unhammer provided but I had a hard time finding the problematic message. (grepping UID didn't help because I had tons of e-mails with the same UID). What I did was to note the number of the problematic box.

C: 0/1  B: 133/162  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Maildir error: UID 22 is beyond highest assigned 

Then I ran with verbose option mbsync -V mymailchannel. The verbose option outputs so much information quite quickly. But I knew where to stop, so I stopped when we passed the number 133. (Of course, you can write it to a file and just grep it with the few lines above).

And there was my problematic folder:

C: 0/1  B: 133/262  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Opening master box INBOX/my_folder/2020/my_other_folder...
Opening slave box INBOX/my_folder/2020/my_other_folder...
Loading master...
Loading slave...
Maildir error: UID 22 is beyond highest assigned UID 21.

And stipped off everything from ,U=22 in my problematic file as @unhammer suggested and my problem was fixed.

s0-0s
  • 134
  • 10