diff --git a/offlineimap/init.py b/offlineimap/init.py index 5c90377..761ff61 100644 --- a/offlineimap/init.py +++ b/offlineimap/init.py @@ -48,7 +48,7 @@ class OfflineImap: if options.diagnostics: self.__serverdiagnostics(options) else: - self.__sync(options) + return self.__sync(options) def __parse_cmd_options(self): parser = OptionParser(version=offlineimap.__bigversion__, @@ -351,11 +351,13 @@ class OfflineImap: offlineimap.mbnames.write(True) self.ui.terminate() + return 0 except (SystemExit): raise except Exception as e: self.ui.error(e) self.ui.terminate() + return 1 def __sync_singlethreaded(self, accs): """Executed if we do not want a separate syncmaster thread