Hi Matthias Sorry for the long response time. I kept forgetting to test it but now it has become more relevant unfortunately. First I took the code I had already, made the change suggested and ran it with incremental = False. That gave some regexp error. Then I created a fresh directory and tried the same which failed with: File "./gui.py", line 358, in run self.func(self.options, self.prog, True) File "/home/tol/Dropbox/bin/backup-gmail/backup_gmail.py", line 527, in doBackup backup.backupTo([options.start_date, options.end_date], overwrite, include_labels, exclude_labels) File "/home/tol/Dropbox/bin/backup-gmail/backup_gmail.py", line 352, in backupTo self.doBackup(date_range, include_labels, exclude_labels) File "/home/tol/Dropbox/bin/backup-gmail/backup_gmail.py", line 339, in doBackup self.fetchAllMail(date_range) File "/home/tol/Dropbox/bin/backup-gmail/backup_gmail.py", line 311, in fetchAllMail self.fetchAllLabel(date_range, exclude_labels) File "/home/tol/Dropbox/bin/backup-gmail/backup_gmail.py", line 300, in fetchAllLabel self.fetchMailByLabel(l, date_range) File "/home/tol/Dropbox/bin/backup-gmail/backup_gmail.py", line 222, in fetchMailByLabel self.fetchMail(uid, seen, label, size) File "/home/tol/Dropbox/bin/backup-gmail/backup_gmail.py", line 279, in fetchMail self.flushFetchMailRequest() File "/home/tol/Dropbox/bin/backup-gmail/backup_gmail.py", line 270, in flushFetchMailRequest self.processMail(rfc[1], *self.fetchBuffer[i]) File "/home/tol/Dropbox/bin/backup-gmail/backup_gmail.py", line 240, in processMail mid = getMID(mail.get('message-id')) File "/home/tol/Dropbox/bin/backup-gmail/backup_gmail.py", line 45, in getMID tmp = re.findall('(<[^>]+>)', env) File "/usr/lib/python2.7/re.py", line 177, in findall return _compile(pattern, flags).findall(string) TypeError: expected string or buffer Then I downloaded the newest (?) with 'bzr branch lp:backup-gmail', added the suggested changes, created a fresh backup dir again and it failed with: File "/home/tol/backup-gmail/backup_gmail.py", line 562, in doBackup(options, TerminalProgress()) File "/home/tol/backup-gmail/backup_gmail.py", line 532, in doBackup backup.backupTo([options.start_date, options.end_date], overwrite, include_labels, exclude_labels) File "/home/tol/backup-gmail/backup_gmail.py", line 355, in backupTo self.doBackup(date_range, include_labels, exclude_labels) File "/home/tol/backup-gmail/backup_gmail.py", line 342, in doBackup self.fetchAllMail(date_range) File "/home/tol/backup-gmail/backup_gmail.py", line 314, in fetchAllMail self.fetchAllLabel(date_range, exclude_labels) File "/home/tol/backup-gmail/backup_gmail.py", line 303, in fetchAllLabel self.fetchMailByLabel(l, date_range) File "/home/tol/backup-gmail/backup_gmail.py", line 222, in fetchMailByLabel self.fetchMail(uid, seen, label, size) File "/home/tol/backup-gmail/backup_gmail.py", line 282, in fetchMail self.flushFetchMailRequest() File "/home/tol/backup-gmail/backup_gmail.py", line 273, in flushFetchMailRequest self.processMail(rfc[1], *self.fetchBuffer[i]) File "/home/tol/backup-gmail/backup_gmail.py", line 243, in processMail mid = getMID(mail.get('message-id')) File "/home/tol/backup-gmail/backup_gmail.py", line 45, in getMID tmp = re.findall('(<[^>]+>)', env) File "/usr/lib/python2.7/re.py", line 177, in findall return _compile(pattern, flags).findall(string) TypeError: expected string or buffer I am totally lost when it comes to regexps so I cannot find any errors myself. Is there another branch I should try or do you have any other suggestions?