diff --git a/offlineimap.conf b/offlineimap.conf index 3d1b4c3..d7c729a 100644 --- a/offlineimap.conf +++ b/offlineimap.conf @@ -183,7 +183,7 @@ accounts = Test # through eval, so you can (and must) use Python quoting. # # The incremental setting controls whether the file is written after each -# account completes or once all synced accounts are complete. This is usefull if +# account completes or once all synced accounts are complete. This is useful if # an account is sightly slower than the other. It allows keeping the previous # file rather than having it partially written. # This works best with "no" if in one-shot mode started by cron or systemd @@ -1016,6 +1016,22 @@ remoteuser = username #maxconnections = 2 +# This option stands in the [Repository RemoteExample] section. +# +# If you want to ensure that only one single thread is used to synchronize each +# folder, set this to 'yes'. If this is set, only one thread will be used to +# copy messages for each folder, but up to maxconnections threads will be used +# overall, copying different folders in parallel. This option is required to +# download in UIDs order. +# +# If this is unset (the default), then up to maxconnections threads are used +# across all currently syncing folders. +# +# This option is EXPERIMENTAL. +# +#singlethreadperfolder = no + + # This option stands in the [Repository RemoteExample] section. # # OfflineIMAP normally closes IMAP server connections between refreshes if diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index edc2735..13d1618 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -79,6 +79,11 @@ class IMAPFolder(BaseFolder): # Interface from BaseFolder def suggeststhreads(self): + onethread = self.config.getdefaultboolean( + "Repository %s"% self.repository.getname(), + "singlethreadperfolder", False) + if onethread is True: + return False return not globals.options.singlethreading # Interface from BaseFolder