<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Thanks Sebastian and Nicolas.<br></div><div>The corrupt data has been found.<br></div><div>You're right it was indeed in the huge file ~/.offlineimap/Repository-IMAPLocal<username>/UIDMapping/INBOX.Sent  <br></div><div>Here are a few lines before and after :</div><div>16731:4777<br>16732:4778<br>16733:4779<br>16734:  P    35:4781<br>16736:4782<br>16737:4783<br>16738:4784<br>They're consecutive UIDs so I re-entered them and filled in the missing numbers in the sequence.</div><div><br></div><br>With the INBOX.Sent file repaired in this user, I re-ran it, and we're down to this same basic error on both mailboxes:<br><br><br>"WARNING: ERROR in syncfolder for username1: null byte in argument for long()"<br>"WARNING: ERROR in syncfolder for username2: null byte in argument for long()"<br>
<br><div><span></span></div><div>Do you have a patch for this "ERROR in syncfolder", to pinpoint the line number and filename ?</div><div><br></div><div><br></div><div>Chris<br></div><div><br></div><div><br><span></span></div><div><span><br></span></div><div>=============<br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;">This function will need much more "robustifying", but the very least we<br>can do is to print the file name and line that are giving trouble.<br><br>Signed-off-by: Sebastian Spaeth <<a ymailto="mailto:Sebastian@SSpaeth.de" href="mailto:Sebastian@SSpaeth.de">Sebastian@SSpaeth.de</a>><br>---<br>Chris, you might want to try this patch to see the exact file name and line<br>that are giving you trouble. Nicolas, I advocate this one for going into master :-)<br><br> Changelog.draft.rst       
    |    1 +<br> offlineimap/folder/UIDMaps.py |    6 +++++-<br> 2 files changed, 6 insertions(+), 1 deletions(-)<br><br>diff --git a/Changelog.draft.rst b/Changelog.draft.rst<br>index d0125b7..11d16ee 100644<br>--- a/Changelog.draft.rst<br>+++ b/Changelog.draft.rst<br>@@ -18,6 +18,7 @@ Changes<br> <br> - no whitespace is stripped from comma-separated arguments passed via<br>   the -f option.<br>+- give more detailed error when encountering a corrupt UID mapping file<br> <br> Bug Fixes<br> ---------<br>diff --git a/offlineimap/folder/UIDMaps.py b/offlineimap/folder/UIDMaps.py<br>index 43b28e4..e87e21e 100644<br>--- a/offlineimap/folder/UIDMaps.py<br>+++ b/offlineimap/folder/UIDMaps.py<br>@@ -51,7 +51,11 @@ class MappingFolderMixIn:<br>                 line = file.readline()<br>                 if not len(line):<br>       
              break<br>-                line = line.strip()<br>+                try:<br>+                    line = line.strip()<br>+                except ValueError:<br>+                    raise Exception("Corrupt line '%s' in UID mapping file '%s'" \<br>+                                        %(line, mapfilename))<br>                 (str1, str2) = line.split(':')<br>                 loc = long(str1)<br>                 rem = long(str2)<br>--
 <br>1.7.4.1<br><br><br><br></div></div></div></body></html>