From 14de280585261abfc9446a5ef37d48f17c5e7686 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Sun, 11 Jan 2015 00:17:08 +0100 Subject: [PATCH 01/14] repository: Base: add comment about lying variable name self.uiddir Signed-off-by: Nicolas Sebrecht --- offlineimap/repository/Base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/offlineimap/repository/Base.py b/offlineimap/repository/Base.py index cb9d06a..d30d8a3 100644 --- a/offlineimap/repository/Base.py +++ b/offlineimap/repository/Base.py @@ -39,6 +39,7 @@ class BaseRepository(CustomConfig.ConfigHelperMixin, object): self.mapdir = os.path.join(self.uiddir, 'UIDMapping') if not os.path.exists(self.mapdir): os.mkdir(self.mapdir, 0o700) + # FIXME: self.uiddir variable name is lying about itself. self.uiddir = os.path.join(self.uiddir, 'FolderValidity') if not os.path.exists(self.uiddir): os.mkdir(self.uiddir, 0o700) From c2b8a99fa23003b0c50a2fc886a417fa34eca129 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Sun, 11 Jan 2015 10:00:37 +0100 Subject: [PATCH 02/14] repository: IMAP.py: do not redefine string Signed-off-by: Nicolas Sebrecht --- offlineimap/repository/IMAP.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 2baa046..0334237 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -326,13 +326,13 @@ class IMAPRepository(BaseRepository): listresult = listfunction(directory = self.imapserver.reference)[1] finally: self.imapserver.releaseconnection(imapobj) - for string in listresult: - if string == None or \ - (isinstance(string, basestring) and string == ''): + for s in listresult: + if s == None or \ + (isinstance(s, basestring) and s == ''): # Bug in imaplib: empty strings in results from # literals. TODO: still relevant? continue - flags, delim, name = imaputil.imapsplit(string) + flags, delim, name = imaputil.imapsplit(s) flaglist = [x.lower() for x in imaputil.flagsplit(flags)] if '\\noselect' in flaglist: continue From a44718130d18c30615762ca0dcccdb30e7ff45c6 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Sun, 11 Jan 2015 13:54:53 +0100 Subject: [PATCH 03/14] minor: add comments Signed-off-by: Nicolas Sebrecht --- offlineimap/accounts.py | 6 ++++++ offlineimap/folder/IMAP.py | 2 ++ offlineimap/init.py | 2 ++ offlineimap/repository/IMAP.py | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py index 91314f9..95b3e9f 100644 --- a/offlineimap/accounts.py +++ b/offlineimap/accounts.py @@ -33,15 +33,21 @@ except: # FIXME: spaghetti code alert! def getaccountlist(customconfig): + # Account names in a list. return customconfig.getsectionlist('Account') # FIXME: spaghetti code alert! def AccountListGenerator(customconfig): + """Returns a list of instanciated Account class, one per account name.""" + return [Account(customconfig, accountname) for accountname in getaccountlist(customconfig)] # FIXME: spaghetti code alert! def AccountHashGenerator(customconfig): + """Returns a dict of instanciated Account class with the account name as + key.""" + retval = {} for item in AccountListGenerator(customconfig): retval[item.getname()] = item diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index e67cb06..00afce0 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -40,6 +40,8 @@ CRLF = '\r\n' class IMAPFolder(BaseFolder): def __init__(self, imapserver, name, repository): + # FIXME: decide if unquoted name is from the responsability of the + # caller or not, but not both. name = imaputil.dequote(name) self.sep = imapserver.delim super(IMAPFolder, self).__init__(name, repository) diff --git a/offlineimap/init.py b/offlineimap/init.py index 878f5cf..f53c9a5 100644 --- a/offlineimap/init.py +++ b/offlineimap/init.py @@ -321,6 +321,8 @@ class OfflineImap: pass try: + # Honor CLI --account option, only. + # Accounts to sync are put into syncaccounts variable. activeaccounts = self.config.get("general", "accounts") if options.accounts: activeaccounts = options.accounts diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 0334237..5b70966 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -301,6 +301,8 @@ class IMAPRepository(BaseRepository): return None def getfolder(self, foldername): + """Return instance of OfflineIMAP representative folder.""" + return self.getfoldertype()(self.imapserver, foldername, self) def getfoldertype(self): @@ -314,6 +316,8 @@ class IMAPRepository(BaseRepository): self.folders = None def getfolders(self): + """Return a list of instances of OfflineIMAP representative folder.""" + if self.folders != None: return self.folders retval = [] From 63e499c6f2f6481891697b6b16a91b23c88e81ba Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Sun, 11 Jan 2015 10:54:19 +0100 Subject: [PATCH 04/14] more consistent style Signed-off-by: Nicolas Sebrecht --- offlineimap/accounts.py | 6 ++++-- offlineimap/repository/GmailMaildir.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py index 95b3e9f..18a36fc 100644 --- a/offlineimap/accounts.py +++ b/offlineimap/accounts.py @@ -60,9 +60,10 @@ class Account(CustomConfig.ConfigHelperMixin): Most of the time you will actually want to use the derived :class:`accounts.SyncableAccount` which contains all functions used for syncing an account.""" - #signal gets set when we should stop looping + + # Signal gets set when we should stop looping. abort_soon_signal = Event() - #signal gets set on CTRL-C/SIGTERM + # Signal gets set on CTRL-C/SIGTERM. abort_NOW_signal = Event() def __init__(self, config, name): @@ -72,6 +73,7 @@ class Account(CustomConfig.ConfigHelperMixin): :param name: A string denoting the name of the Account as configured""" + self.config = config self.name = name self.metadatadir = config.getmetadatadir() diff --git a/offlineimap/repository/GmailMaildir.py b/offlineimap/repository/GmailMaildir.py index b790c73..61352f8 100644 --- a/offlineimap/repository/GmailMaildir.py +++ b/offlineimap/repository/GmailMaildir.py @@ -23,8 +23,8 @@ class GmailMaildirRepository(MaildirRepository): def __init__(self, reposname, account): """Initialize a MaildirRepository object. Takes a path name to the directory holding all the Maildir directories.""" - super(GmailMaildirRepository, self).__init__(reposname, account) + super(GmailMaildirRepository, self).__init__(reposname, account) def getfoldertype(self): return GmailMaildirFolder From 29e9b7ab39c0f1589814d451204a105067f490ea Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Sun, 5 Jan 2014 16:07:03 +0100 Subject: [PATCH 05/14] Drop caches after having processed folders. This enhances a lot memory consumption when you have many folders to process. Signed-off-by: Giovanni Mascellani --- offlineimap/accounts.py | 4 ++++ offlineimap/folder/Base.py | 3 +++ offlineimap/folder/IMAP.py | 2 ++ offlineimap/folder/LocalStatus.py | 2 ++ offlineimap/folder/LocalStatusSQLite.py | 3 +++ offlineimap/folder/Maildir.py | 3 +++ offlineimap/folder/UIDMaps.py | 3 +++ 7 files changed, 20 insertions(+) diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py index 18a36fc..7adc3a4 100644 --- a/offlineimap/accounts.py +++ b/offlineimap/accounts.py @@ -491,3 +491,7 @@ def syncfolder(account, remotefolder, quick): ui.error(e, msg = "ERROR in syncfolder for %s folder %s: %s" % \ (account, remotefolder.getvisiblename(), traceback.format_exc())) + finally: + for folder in ["statusfolder", "localfolder", "remotefolder"]: + if folder in locals(): + locals()[folder].dropmessagelistcache() diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py index 87e165c..7121231 100644 --- a/offlineimap/folder/Base.py +++ b/offlineimap/folder/Base.py @@ -247,6 +247,9 @@ class BaseFolder(object): raise NotImplementedError + def dropmessagelistcache(self): + raise NotImplementedException + def getmessagelist(self): """Gets the current message list. You must call cachemessagelist() before calling this function!""" diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 00afce0..c405431 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -250,6 +250,8 @@ class IMAPFolder(BaseFolder): rtime = imaplibutil.Internaldate2epoch(messagestr) self.messagelist[uid] = {'uid': uid, 'flags': flags, 'time': rtime} + def dropmessagelistcache(self): + self.messagelist = None # Interface from BaseFolder def getmessagelist(self): diff --git a/offlineimap/folder/LocalStatus.py b/offlineimap/folder/LocalStatus.py index ec34965..d3b6cf0 100644 --- a/offlineimap/folder/LocalStatus.py +++ b/offlineimap/folder/LocalStatus.py @@ -161,6 +161,8 @@ class LocalStatusFolder(BaseFolder): self.readstatus(file) file.close() + def dropmessagelistcache(self): + self.messagelist = None def save(self): """Save changed data to disk. For this backend it is the same as saveall.""" diff --git a/offlineimap/folder/LocalStatusSQLite.py b/offlineimap/folder/LocalStatusSQLite.py index 1b2adb0..9d7e559 100644 --- a/offlineimap/folder/LocalStatusSQLite.py +++ b/offlineimap/folder/LocalStatusSQLite.py @@ -203,6 +203,9 @@ class LocalStatusSQLiteFolder(BaseFolder): self.messagelist[uid]['labels'] = labels self.messagelist[uid]['mtime'] = row[2] + def dropmessagelistcache(self): + self.messagelist = None + # Interface from LocalStatusFolder def save(self): pass diff --git a/offlineimap/folder/Maildir.py b/offlineimap/folder/Maildir.py index af1e5ff..3a19cc3 100644 --- a/offlineimap/folder/Maildir.py +++ b/offlineimap/folder/Maildir.py @@ -220,6 +220,9 @@ class MaildirFolder(BaseFolder): if self.messagelist is None: self.messagelist = self._scanfolder() + def dropmessagelistcache(self): + self.messagelist = None + # Interface from BaseFolder def getmessagelist(self): return self.messagelist diff --git a/offlineimap/folder/UIDMaps.py b/offlineimap/folder/UIDMaps.py index e1a6f5f..eb4fbae 100644 --- a/offlineimap/folder/UIDMaps.py +++ b/offlineimap/folder/UIDMaps.py @@ -125,6 +125,9 @@ class MappedIMAPFolder(IMAPFolder): finally: self.maplock.release() + def dropmessagelistcache(self): + self._mb.dropmessagelistcache() + # Interface from BaseFolder def uidexists(self, ruid): """Checks if the (remote) UID exists in this Folder""" From d08f6d15c21a1517ee27d894a051f3199cda4d8c Mon Sep 17 00:00:00 2001 From: Wieland Hoffmann Date: Sun, 11 Jan 2015 18:15:16 +0100 Subject: [PATCH 06/14] addmessageheader: Add a note about the incorrect rendering of the docstring The note tells people to look at the source of the method, which spinx.ext.viewcode conveniently links right next to the methods signature. Signed-off-by: Wieland Hoffmann --- docs/doc-src/conf.py | 3 ++- offlineimap/folder/Base.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/doc-src/conf.py b/docs/doc-src/conf.py index e961ab2..3f4bb6c 100644 --- a/docs/doc-src/conf.py +++ b/docs/doc-src/conf.py @@ -23,7 +23,8 @@ from offlineimap import __version__,__author__ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', + 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.viewcode'] autoclass_content = "both" # Add any paths that contain templates here, relative to this directory. diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py index 7121231..55b2bfc 100644 --- a/offlineimap/folder/Base.py +++ b/offlineimap/folder/Base.py @@ -441,6 +441,11 @@ class BaseFolder(object): - headername: name of the header to add - headervalue: value of the header to add + .. note:: + + The following documentation will not get displayed correctly after being + processed by Sphinx. View the source of this method to read it. + This has to deal with strange corner cases where the header is missing or empty. Here are illustrations for all the cases, showing where the header gets inserted and what the end result From 6fc9c3601452c902f5c815ba811560c2f9cae966 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Mon, 12 Jan 2015 19:15:06 +0300 Subject: [PATCH 07/14] Fix regression introduced in 0f40ca47998c7f56bf7cd1ce095c66fe93e21d03 We have no variable "fullname", it must have been slipped in unintentionally. Blame commit: 0f40ca47998c7f more style consistency Signed-off-by: Eygene Ryabinkin Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/IMAP.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index c405431..e0c0cc7 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -571,7 +571,7 @@ class IMAPFolder(BaseFolder): #Do the APPEND try: - (typ, dat) = imapobj.append(fullname, + (typ, dat) = imapobj.append(self.getfullname(), imaputil.flagsmaildir2imap(flags), date, content) # This should only catch 'NO' responses since append() # will raise an exception for 'BAD' responses: From 41fa3ae4fceb92619e1ee23423b3115494d25c7b Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Tue, 13 Jan 2015 13:59:52 +0100 Subject: [PATCH 08/14] more style consistency Signed-off-by: Nicolas Sebrecht --- offlineimap/accounts.py | 4 ++-- offlineimap/init.py | 1 + offlineimap/repository/IMAP.py | 5 ++--- offlineimap/repository/LocalStatus.py | 3 ++- offlineimap/repository/Maildir.py | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py index 7adc3a4..73b8ff1 100644 --- a/offlineimap/accounts.py +++ b/offlineimap/accounts.py @@ -265,8 +265,8 @@ class SyncableAccount(Account): raise self.ui.error(e, exc_info()[2]) except Exception as e: - self.ui.error(e, exc_info()[2], msg = "While attempting to sync" - " account '%s'" % self) + self.ui.error(e, exc_info()[2], msg="While attempting to sync" + " account '%s'"% self) else: # after success sync, reset the looping counter to 3 if self.refreshperiod: diff --git a/offlineimap/init.py b/offlineimap/init.py index f53c9a5..8b20394 100644 --- a/offlineimap/init.py +++ b/offlineimap/init.py @@ -40,6 +40,7 @@ class OfflineImap: oi = OfflineImap() oi.run() """ + def run(self): """Parse the commandline and invoke everything""" # next line also sets self.config and self.ui diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 5b70966..c59b3a8 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -357,9 +357,8 @@ class IMAPRepository(BaseRepository): self.ui.error(e, exc_info()[2], 'Invalid folderinclude:') continue - retval.append(self.getfoldertype()(self.imapserver, - foldername, - self)) + retval.append(self.getfoldertype()( + self.imapserver, foldername, self)) finally: self.imapserver.releaseconnection(imapobj) diff --git a/offlineimap/repository/LocalStatus.py b/offlineimap/repository/LocalStatus.py index 1390347..170145b 100644 --- a/offlineimap/repository/LocalStatus.py +++ b/offlineimap/repository/LocalStatus.py @@ -94,7 +94,8 @@ class LocalStatusRepository(BaseRepository): self.forgetfolders() def getfolder(self, foldername): - """Return the Folder() object for a foldername""" + """Return the Folder() object for a foldername.""" + if foldername in self._folders: return self._folders[foldername] diff --git a/offlineimap/repository/Maildir.py b/offlineimap/repository/Maildir.py index be86b34..58bf664 100644 --- a/offlineimap/repository/Maildir.py +++ b/offlineimap/repository/Maildir.py @@ -170,8 +170,8 @@ class MaildirRepository(BaseRepository): self.debug(" skip this entry (not a directory)") # Not a directory -- not a folder. continue + # extension can be None. if extension: - # extension can be None which fails. foldername = os.path.join(extension, dirname) else: foldername = dirname From 5c56d4f8ab8864749c448490b91108f87ea59633 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Tue, 13 Jan 2015 18:18:03 +0100 Subject: [PATCH 09/14] docs: CodingGuidelines: remove duplicate content Signed-off-by: Nicolas Sebrecht --- docs/CodingGuidelines.rst | 51 --------------------------------------- 1 file changed, 51 deletions(-) diff --git a/docs/CodingGuidelines.rst b/docs/CodingGuidelines.rst index d6d29a2..92cc3be 100644 --- a/docs/CodingGuidelines.rst +++ b/docs/CodingGuidelines.rst @@ -13,57 +13,6 @@ This document contains assorted guidelines for programmers that want to hack OfflineIMAP. ------------------- -Exception handling ------------------- - -OfflineIMAP on many occasions re-raises various exceptions and often -changes exception type to `OfflineImapError`. This is not a problem -per se, but you must always remember that we need to preserve original -tracebacks. This is not hard if you follow these simple rules. - -For re-raising original exceptions, just use:: - - raise - -from inside your exception handling code. - -If you need to change exception type, or its argument, or whatever, -use this three-argument form:: - - raise YourExceptionClass(argum, ents), None, sys.exc_info()[2] - -In this form, you're creating an instance of new exception, so ``raise`` -will deduce its ``type`` and ``value`` parameters from the first argument, -thus the second expression passed to ``raise`` is always ``None``. -And the third one is the traceback object obtained from the thread-safe -``exc_info()`` function. - -In fact, if you hadn't already imported the whole ``sys`` module, it will -be better to import just ``exc_info()``:: - - from sys import exc_info - -and raise like this:: - - raise YourExceptionClass(argum, ents), None, exc_info()[2] - -since this is the historically-preferred style in the OfflineIMAP code. -.. -*- coding: utf-8 -*- -.. _OfflineIMAP: https://github.com/OfflineIMAP/offlineimap -.. _OLI_git_repo: git://github.com/OfflineIMAP/offlineimap.git - -================================= -Coding guidelines for OfflineIMAP -================================= - -.. contents:: -.. .. sectnum:: - -This document contains assorted guidelines for programmers that want -to hack OfflineIMAP. - - ------------------ Exception handling ------------------ From ab3423d039393c3ac3e325012774a06b3a1964a6 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Tue, 13 Jan 2015 22:48:28 +0100 Subject: [PATCH 10/14] localeval: avoid redefining 'file' keyword Signed-off-by: Nicolas Sebrecht --- offlineimap/localeval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/offlineimap/localeval.py b/offlineimap/localeval.py index 06adc57..a9494fb 100644 --- a/offlineimap/localeval.py +++ b/offlineimap/localeval.py @@ -31,10 +31,10 @@ class LocalEval: if path is not None: # FIXME: limit opening files owned by current user with rights set # to fixed mode 644. - file = open(path, 'r') + foo = open(path, 'r') module = imp.load_module( '', - file, + foo, path, ('', 'r', imp.PY_SOURCE)) for attr in dir(module): From 03eafcc00f36f9a840eb9d99c5f351d79219dd4b Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Wed, 14 Jan 2015 17:12:08 +0100 Subject: [PATCH 11/14] offlineimap.conf: normalize style and format - improve style and reading for the eyes - improve wording - add minor comments - remove on duplicate option - give location of each +1 section Signed-off-by: Nicolas Sebrecht --- offlineimap.conf | 701 +++++++++++++++++++++++++++++------------------ 1 file changed, 433 insertions(+), 268 deletions(-) diff --git a/offlineimap.conf b/offlineimap.conf index d953f0e..e0ef4f4 100644 --- a/offlineimap.conf +++ b/offlineimap.conf @@ -5,7 +5,8 @@ # More details can be found in the included user documention, which is # also available at: http://docs.offlineimap.org/en/latest/ -# NOTE: Settings generally support python interpolation. This means + +# NOTE 1: Settings generally support python interpolation. This means # values can contain python format strings which refer to other values # in the same section, or values in a special DEFAULT section. This # allows you for example to use common settings for multiple accounts: @@ -21,49 +22,58 @@ # # would set the trashfolder setting for your German Gmail accounts. -# NOTE2: This implies that any '%' needs to be encoded as '%%' +# NOTE 2: Above feature implies that any '%' needs to be encoded as '%%' -# NOTE3: Any variables that are subject to the environment variables +# NOTE 3: Any variable that is subject to the environment variables # ($NAME) and tilde (~username/~) expansions will receive tilde -# expansion first and only after this environment variables will be -# expanded in the resulting string. This behaviour is intentional +# expansion first and only after the environment variable will be +# expanded in the resulting string. This behaviour is intentional # as it coincides with typical shell expansion strategy. + ################################################## # General definitions ################################################## [general] -# This specifies where offlineimap is to store its metadata. +# This specifies where OfflineIMAP is to store its metadata. # This directory will be created if it does not already exist. # # Tilde and environment variable expansions will be performed. - +# #metadata = ~/.offlineimap -# This variable specifies which accounts are defined. Separate them -# with commas. Account names should be alphanumeric only. -# You will need to specify one section per account below. You may -# not use "general" for an account name. +# This option stands in the [general] section. +# +# This variable specifies which accounts are defined. Separate them with commas. +# Account names should be alphanumeric only. You will need to specify one +# section per account below. You may not use "general" for an account name. +# +# Always use ASCII characters only. +# accounts = Test -# Offlineimap can synchronize more than one account at a time. If you -# want to enable this feature, set the below value to something -# greater than 1. To force it to synchronize only one account at a -# time, set it to 1. -# -# Note: if you are using autorefresh and have more than one account, -# you must set this number to be >= to the number of accounts you have; -# since any given sync run never "finishes" due to a timer, you will never -# sync your additional accounts if this is 1. +# This option stands in the [general] section. +# +# Offlineimap can synchronize more than one account at a time. If you want to +# enable this feature, set the below value to something greater than 1. To +# force it to synchronize only one account at a time, set it to 1. +# +# NOTE: if you are using autorefresh and have more than one account, you must +# set this number to be >= to the number of accounts you have; since any given +# sync run never "finishes" due to a timer, you will never sync your additional +# accounts if this is 1. +# #maxsyncaccounts = 1 -# You can specify one or more user interface modules for OfflineIMAP -# to use. OfflineIMAP will try the first in the list, and if it -# fails, the second, and so forth. + +# This option stands in the [general] section. +# +# You can specify one or more user interface. OfflineIMAP will try the first in +# the list, and if it fails, the second, and so forth. # # The pre-defined options are: # Blinkenlights -- A fancy (terminal) interface @@ -75,22 +85,28 @@ accounts = Test # parsing. # # You can override this with a command-line option -u. - +# #ui = basic + +# This option stands in the [general] section. +# # If you try to synchronize messages to a folder which the IMAP server # considers read-only, OfflineIMAP will generate a warning. If you want # to suppress these warnings, set ignore-readonly to yes. Read-only # IMAP folders allow reading but not modification, so if you try to # change messages in the local copy of such a folder, the IMAP server # will prevent OfflineIMAP from propagating those changes to the IMAP -# server. Note that ignore-readonly is unrelated to the "readonly" +# server. Note that ignore-readonly is UNRELATED to the "readonly" # setting which prevents a repository from being modified at all. - +# #ignore-readonly = no + ########## Advanced settings +# This option stands in the [general] section. +# # You can give a Python source filename here and all config file # python snippets will be evaluated in the context of that file. # This allows you to e.g. define helper functions in the Python @@ -99,31 +115,36 @@ accounts = Test # # Tilde and environment variable expansions will be performed. # -# pythonfile = ~/.offlineimap.py -# +#pythonfile = ~/.offlineimap.py -# By default, OfflineIMAP will not exit due to a network error until -# the operating system returns an error code. Operating systems can sometimes -# take forever to notice this. Here you can activate a timeout on the -# socket. This timeout applies to individual socket reads and writes, -# not to an overall sync operation. You could perfectly well have a 30s -# timeout here and your sync still take minutes. + +# This option is in the [general] section. +# +# By default, OfflineIMAP will not exit due to a network error until the +# operating system returns an error code. Operating systems can sometimes take +# forever to notice this. Here you can activate a timeout on the socket. This +# timeout applies to individual socket reads and writes, not to an overall sync +# operation. You could perfectly well have a 30s timeout here and your sync +# still take minutes. # # Values in the 30-120 second range are reasonable. # # The default is to have no timeout beyond the OS. Times are given in seconds. # -# socktimeout = 60 +#socktimeout = 60 -# By default, OfflineIMAP will use fsync() to force data out to disk at -# opportune times to ensure consistency. This can, however, reduce -# performance. Users where /home is on SSD (Flash) may also wish to reduce -# write cycles. Therefore, you can disable OfflineIMAP's use of fsync(). -# Doing so will come at the expense of greater risk of message duplication -# in the event of a system crash or power loss. Default is fsync = true. -# Set fsync = false to disable fsync. + +# This option stands in the [general] section. # -# fsync = true +# By default, OfflineIMAP will use fsync() to force data out to disk at +# opportune times to ensure consistency. This can, however, reduce performance. +# Users where /home is on SSD (Flash) may also wish to reduce write cycles. +# Therefore, you can disable OfflineIMAP's use of fsync(). Doing so will come +# at the expense of greater risk of message duplication in the event of a system +# crash or power loss. Default is true. Set it to false to disable fsync. +# +#fsync = true + ################################################## # Mailbox name recorder @@ -131,7 +152,7 @@ accounts = Test [mbnames] -# offlineimap can record your mailbox names in a format you specify. +# OfflineIMAP can record your mailbox names in a format you specify. # You can define the header, each mailbox item, the separator, # and the footer. Here is an example for Mutt. # If enabled is yes, all six setting must be specified, even if they @@ -148,47 +169,46 @@ accounts = Test # # Tilde and environment variable expansions will be performed # for "filename" knob. +# +#enabled = no +#filename = ~/Mutt/muttrc.mailboxes +#header = "mailboxes " +#peritem = "+%(accountname)s/%(foldername)s" +#sep = " " +#footer = "\n" -enabled = no -filename = ~/Mutt/muttrc.mailboxes -header = "mailboxes " -peritem = "+%(accountname)s/%(foldername)s" -sep = " " -footer = "\n" -# You can also specify a folderfilter. It will apply to the -# *translated* folder name here, and it takes TWO arguments: -# accountname and foldername. In all other ways, it will -# behave identically to the folderfilter for accounts. Please see -# that section for more information and examples. +# This option stands in the [mbnames] section. # -# Note that this filter can be used only to further restrict mbnames -# to a subset of folders that pass the account's folderfilter. +# You can also specify a folderfilter. It will apply to the *translated* folder +# name here, and it takes TWO arguments: accountname and foldername. In all +# other ways, it will behave identically to the folderfilter for accounts. +# Please see the folderfilter option for more information and examples. # +# This filter can be used only to further restrict mbnames to a subset of +# folders that pass the account's folderfilter. # -# You can customize the order in which mailbox names are listed in the -# generated file by specifying a sort_keyfunc, which takes a single -# dict argument containing keys 'accountname' and 'foldername'. This -# function will be called once for each mailbox, and should return a -# suitable sort key that defines this mailbox' position in the custom -# ordering. +# You can customize the order in which mailbox names are listed in the generated +# file by specifying a sort_keyfunc, which takes a single dict argument +# containing keys 'accountname' and 'foldername'. This function will be called +# once for each mailbox, and should return a suitable sort key that defines this +# mailbox' position in the custom ordering. # -# This is useful with e.g. Mutt-sidebar, which uses the mailbox order -# from the generated file when listing mailboxes in the sidebar. +# This is useful with e.g. Mutt-sidebar, which uses the mailbox order from the +# generated file when listing mailboxes in the sidebar. # -# Default setting is -# sort_keyfunc = lambda d: (d['accountname'], d['foldername']) +# Default setting is: +#sort_keyfunc = lambda d: (d['accountname'], d['foldername']) ################################################## # Accounts ################################################## -# This is an account definition clause. You'll have one of these -# for each account listed in general/accounts above. +# This is an account definition clause. You'll have one of these for each +# account listed in the "accounts" option in [general] section (above). [Account Test] -########## Basic settings # These settings specify the two folders that you will be syncing. # You'll need to have a "Repository ..." section for each one. @@ -196,44 +216,58 @@ footer = "\n" localrepository = LocalExample remoterepository = RemoteExample + ########## Advanced settings -# You can have offlineimap continue running indefinitely, automatically -# syncing your mail periodically. If you want that, specify how -# frequently to do that (in minutes) here. You can also specify -# fractional minutes (ie, 3.25). +# This option stands in the [Account Test] section. +# +# You can have OfflineIMAP continue running indefinitely, automatically syncing +# your mail periodically. If you want that, specify how frequently to do that +# (in minutes) here. Fractional minutes (ie, 3.25) is allowed. +# +#autorefresh = 5 -# autorefresh = 5 -# OfflineImap can replace a number of full updates by quick -# synchronizations. It only synchronizes a folder if 1) a Maildir -# folder has changed, or 2) if an IMAP folder has received new messages -# or had messages deleted, ie it does not update if only IMAP flags have -# changed. Full updates need to fetch ALL flags for all messages, so -# this makes quite a performance difference (especially if syncing -# between two IMAP servers). -# Specify 0 for never, -1 for always (works even in non-autorefresh -# mode), or a positive integer to do quick updates before doing -# another full synchronization (requires autorefresh). Updates are -# always performed after minutes, be they quick or full. +# This option stands in the [Account Test] section. +# +# OfflineImap can replace a number of full updates by quick synchronizations. +# It only synchronizes a folder if +# +# 1) a Maildir folder has changed +# +# or +# +# 2) if an IMAP folder has received new messages or had messages deleted, ie +# it does not update if only IMAP flags have changed. +# +# Full updates need to fetch ALL flags for all messages, so this makes quite a +# performance difference (especially if syncing between two IMAP servers). +# +# Specify 0 for never, -1 for always (works even in non-autorefresh mode) +# +# A positive integer to do quick updates before doing another full +# synchronization (requires autorefresh). Updates are always performed after +# minutes, be they quick or full. +# +#quick = 10 -# quick = 10 -# You can specify a pre and post sync hook to execute a external command. -# In this case a call to imapfilter to filter mail before the sync process -# starts and a custom shell script after the sync completes. -# The pre sync script has to complete before a sync to the account will -# start. +# This option stands in the [Account Test] section. +# +# You can specify a pre and post sync hook to execute a external command. In +# this case a call to imapfilter to filter mail before the sync process starts +# and a custom shell script after the sync completes. +# +# The pre sync script has to complete before a sync to the account will start. +# +#presynchook = imapfilter -c someotherconfig.lua +#postsynchook = notifysync.sh -# presynchook = imapfilter -# postsynchook = notifysync.sh - -# You can also specify parameters to the commands -# presynchook = imapfilter -c someotherconfig.lua +# This option stands in the [Account Test] section. +# # OfflineImap caches the state of the synchronisation to e.g. be able to -# determine if a mail has been deleted on one side or added on the -# other. +# determine if a mail has been added or deleted on either side. # # The default and historical backend is 'plain' which writes out the # state in plain text files. On Repositories with large numbers of @@ -247,66 +281,92 @@ remoterepository = RemoteExample # #status_backend = plain + +# This option stands in the [Account Test] section. +# # If you have a limited amount of bandwidth available you can exclude larger -# messages (e.g. those with large attachments etc). If you do this it -# will appear to offlineimap that these messages do not exist at all. They -# will not be copied, have flags changed etc. For this to work on an IMAP -# server the server must have server side search enabled. This works with Gmail -# and most imap servers (e.g. cyrus etc) +# messages (e.g. those with large attachments etc). If you do this it will +# appear to OfflineIMAP that these messages do not exist at all. They will not +# be copied, have flags changed etc. For this to work on an IMAP server the +# server must have server side search enabled. This works with Gmail and most +# imap servers (e.g. cyrus etc) +# # The maximum size should be specified in bytes - e.g. 2000000 for approx 2MB - -# maxsize = 2000000 +# +#maxsize = 2000000 +# This option stands in the [Account Test] section. +# # When you are starting to sync an already existing account you can tell -# offlineimap to sync messages from only the last x days. When you do -# this messages older than x days will be completely ignored. This can -# be useful for importing existing accounts when you do not want to -# download large amounts of archive email. +# OfflineIMAP to sync messages from only the last x days. When you do this, +# messages older than x days will be completely ignored. This can be useful for +# importing existing accounts when you do not want to download large amounts of +# archive email. # -# Messages older than maxage days will not be synced, their flags will -# not be changed, they will not be deleted etc. For offlineimap it will -# be like these messages do not exist. This will perform an IMAP search -# in the case of IMAP or Gmail and therefore requires that the server -# support server side searching. This will calculate the earliest day -# that would be included in the search and include all messages from -# that day until today. e.g. maxage = 3 to sync only the last 3 days -# mail +# Messages older than maxage days will not be synced, their flags will not be +# changed, they will not be deleted, etc. For OfflineIMAP it will be like these +# messages do not exist. This will perform an IMAP search in the case of IMAP +# or Gmail and therefore requires that the server support server side searching. +# This will calculate the earliest day that would be included in the search and +# include all messages from that day until today. The maxage option expects an +# integer (for the number of days). # -# maxage = +#maxage = 3 +# This option stands in the [Account Test] section. +# # Maildir file format uses colon (:) separator between uniq name and info. # Unfortunatelly colon is not allowed character in windows file name. If you -# enable maildir-windows-compatible option, offlineimap will be able to store +# enable maildir-windows-compatible option, OfflineIMAP will be able to store # messages on windows drive, but you will probably loose compatibility with -# other programs working with the maildir +# other programs working with the maildir. # #maildir-windows-compatible = no + +# This option stands in the [Account Test] section. +# # Specifies if we want to sync GMail labels with the local repository. # Effective only for GMail IMAP repositories. # +# Non-ASCII characters in labels are bad handled or won't work at all. +# #synclabels = no + +# This option stands in the [Account Test] section. +# # Name of the header to use for label storage. Format for the header # value differs for different headers, because there are some de-facto -# standards set by popular clients: +# "standards" set by popular clients: +# # - X-Label or Keywords keep values separated with spaces; for these # you, obviously, should not have label values that contain spaces; +# # - X-Keywords use comma (',') as the separator. +# # To be consistent with the usual To-like headers, for the rest of header # types we use comma as the separator. # +# Use ASCII characters only. +# #labelsheader = X-Keywords + +# This option stands in the [Account Test] section. +# # Set of labels to be ignored. Comma-separated list. GMail-specific # labels all start with backslash ('\'). # +# Use ASCII characters only. +# #ignorelabels = \Inbox, \Starred, \Sent, \Draft, \Spam, \Trash, \Important - +# This option stands in the [Account Test] section. +# # OfflineIMAP can strip off some headers when your messages are propagated # back to the IMAP server. This option carries the comma-separated list # of headers to trim off. Header name matching is case-sensitive. @@ -315,23 +375,30 @@ remoterepository = RemoteExample # for GMail-based accounts is automatically added to this list, you don't # need to specify it explicitely. # +# Use ASCII characters only. +# #filterheaders = X-Some-Weird-Header - [Repository LocalExample] # Each repository requires a "type" declaration. The types supported for # local repositories are Maildir, GmailMaildir and IMAP. - +# type = Maildir + +# This option stands in the [Repository LocalExample] section. +# # Specify local repository. Your IMAP folders will be synchronized # to maildirs created under this path. OfflineIMAP will create the # maildirs for you as needed. - +# localfolders = ~/Test + +# This option stands in the [Repository LocalExample] section. +# # You can specify the "folder separator character" used for your Maildir # folders. It is inserted in-between the components of the tree. If you # want your folders to be nested directories, set it to "/". 'sep' is @@ -339,6 +406,9 @@ localfolders = ~/Test # #sep = . + +# This option stands in the [Repository LocalExample] section. +# # Some users may not want the atime (last access time) of folders to be # modified by OfflineIMAP. If 'restoreatime' is set to yes, OfflineIMAP # will restore the atime of the "new" and "cur" folders in each maildir @@ -349,7 +419,6 @@ localfolders = ~/Test #restoreatime = no - [Repository GmailLocalExample] # This type of repository enables syncing of Gmail. All Maildir @@ -362,43 +431,64 @@ localfolders = ~/Test # time OfflineIMAP runs with synclabels enabled, it will have to check # the contents of all individual messages for labels and this may take # a while. - +# type = GmailMaildir - [Repository RemoteExample] -# And this is the remote repository. We only support IMAP or Gmail here. +# The remote repository. We only support IMAP or Gmail here. +# type = IMAP + +# These options stands in the [Repository RemoteExample] section. +# # The following can fetch the account credentials via a python expression that # is parsed from the pythonfile parameter. For example, a function called # "getcredentials" that parses a file "filename" and returns the account # details for "hostname". -# remotehosteval = getcredentials("filename", "hostname", "hostname") -# remoteporteval = getcredentials("filename", "hostname", "port") -# remoteusereval = getcredentials("filename", "hostname", "user") -# remotepasseval = getcredentials("filename", "hostname", "passwd") +# +#remotehosteval = getcredentials("filename", "hostname", "hostname") +#remoteporteval = getcredentials("filename", "hostname", "port") +#remoteusereval = getcredentials("filename", "hostname", "user") +#remotepasseval = getcredentials("filename", "hostname", "passwd") + +# This option stands in the [Repository RemoteExample] section. +# # Specify the remote hostname. +# remotehost = examplehost + +# This option stands in the [Repository RemoteExample] section. +# # Whether or not to use SSL. -ssl = yes +# +#ssl = yes -# SSL Client certificate (optional) + +# This option stands in the [Repository RemoteExample] section. +# +# SSL Client certificate (optional). # # Tilde and environment variable expansions will be performed. +# +#sslclientcert = /path/to/file.crt -# sslclientcert = /path/to/file.crt -# SSL Client key (optional) +# This option stands in the [Repository RemoteExample] section. +# +# SSL Client key (optional). # # Tilde and environment variable expansions will be performed. +# +#sslclientkey = /path/to/file.key -# sslclientkey = /path/to/file.key +# This option stands in the [Repository RemoteExample] section. +# # SSL CA Cert(s) to verify the server cert against (optional). # No SSL verification is done without this option. If it is # specified, the CA Cert(s) need to verify the Server cert AND @@ -406,15 +496,18 @@ ssl = yes # The certificate should be in PEM format. # # Tilde and environment variable expansions will be performed. +# +#sslcacertfile = /path/to/cacertfile.crt -# sslcacertfile = /path/to/cacertfile.crt -# If you connect via SSL/TLS (ssl=true) and you have no CA certificate -# specified, offlineimap will refuse to sync as it connects to a server +# This option stands in the [Repository RemoteExample] section. +# +# If you connect via SSL/TLS (ssl = yes) and you have no CA certificate +# specified, OfflineIMAP will refuse to sync as it connects to a server # with an unknown "fingerprint". If you are sure you connect to the # correct server, you can then configure the presented server # fingerprint here. OfflineImap will verify that the server fingerprint -# has not changed on each connect and refuse to connect otherwise. +# has not changed on each connection and refuse to connect otherwise. # You can also configure this in addition to CA certificate validation # above and it will check both ways. # @@ -422,26 +515,41 @@ ssl = yes # # Fingerprints must be in hexadecimal form without leading '0x': # 40 hex digits like bbfe29cf97acb204591edbafe0aa8c8f914287c9. - +# #cert_fingerprint = [, ] -# SSL version (optional) + +# This option stands in the [Repository RemoteExample] section. +# +# SSL version (optional). +# # It is best to leave this unset, in which case the correct version will be # automatically detected. In rare cases, it may be necessary to specify a # particular version from: tls1, ssl2, ssl3, ssl23 (SSLv2 or SSLv3) +# +#ssl_version = ssl23 -# ssl_version = ssl23 +# This option stands in the [Repository RemoteExample] section. +# # Specify the port. If not specified, use a default port. -# remoteport = 993 +# +#remoteport = 993 + +# This option stands in the [Repository RemoteExample] section. +# # Specify the remote user name. +# remoteuser = username + +# This option stands in the [Repository RemoteExample] section. +# # Specify the user to be authorized as. Sometimes we want to # authenticate with our login/password, but tell the server that we # really want to be treated as some other user; perhaps server will -# allow us to do that (or, may be, not). Some IMAP servers migrate +# allow us to do that (or maybe not). Some IMAP servers migrate # account names using this functionality: your credentials remain # intact, but remote identity changes. # @@ -449,20 +557,23 @@ remoteuser = username # mechanism, so consider using auth_mechanisms to prioritize PLAIN # or even make it the only mechanism to be tried. # -# remote_identity = authzuser +#remote_identity = authzuser -# Specify which authentication/authorization mechanisms we should try -# and the order in which OfflineIMAP will try them. NOTE: any given -# mechanism will be tried only if it is supported by the remote IMAP -# server. + +# This option stands in the [Repository RemoteExample] section. # -# Due to the technical limitations, if you're specifying GSSAPI -# as the mechanism to try, it will be tried first, no matter where -# it was specified in the list. +# Specify which authentication/authorization mechanisms we should try and the +# order in which OfflineIMAP will try them. # -# Default value is -# auth_mechanisms = GSSAPI, CRAM-MD5, PLAIN, LOGIN -# ranged is from strongest to more weak ones. +# NOTE: any given mechanism will be tried ONLY if it is supported by the remote +# IMAP server. +# +# Default value is ranged is from strongest to more weak ones. Due to technical +# limitations, if GSSAPI is set, it will be tried first, no matter where it was +# specified in the list. +# +#auth_mechanisms = GSSAPI, CRAM-MD5, PLAIN, LOGIN + ########## Passwords @@ -507,9 +618,13 @@ remoteuser = username # This method can be used to design more elaborate setups, e.g. by # querying the gnome-keyring via its python bindings. + ########## Advanced settings -# Tunnels. There are two types: + +# These options stands in the [Repository RemoteExample] section. +# +# Tunnels. There are two types: # # - preauth: they teleport your connection to the remote system # and you don't need to authenticate yourself there; the sole @@ -521,57 +636,73 @@ remoteuser = username # IMAP server. # # Tunnels are currently working only with IMAP servers and their -# derivatives (currently, GMail). Additionally, for GMail accounts +# derivatives (GMail currently). Additionally, for GMail accounts # preauth tunnel settings are ignored: we don't believe that there # are ways to preauthenticate at Google mail system IMAP servers. # -# You must choose at most one tunnel type, be wise M'Lord. +# You must choose at most one tunnel type, be wise M'Lord! # -# preauthtunnel = ssh -q imaphost '/usr/bin/imapd ./Maildir' -# transporttunnel = openssl s_client -host myimap -port 993 -quiet +#preauthtunnel = ssh -q imaphost '/usr/bin/imapd ./Maildir' +#transporttunnel = openssl s_client -host myimap -port 993 -quiet -# Some IMAP servers need a "reference" which often refers to the "folder -# root". This is most commonly needed with UW IMAP, where you might -# need to specify the directory in which your mail is stored. The -# 'reference' value will be prefixed to all folder paths refering to -# that repository. E.g. accessing folder 'INBOX' with reference = Mail -# will try to access Mail/INBOX. Note that the nametrans and -# folderfilter functions will still apply the full path including the -# reference prefix. Most users will not need this. + +# This option stands in the [Repository RemoteExample] section. # -# reference = Mail +# Some IMAP servers need a "reference" which often refers to the "folder root". +# +# This is most commonly needed with UW IMAP, where you might need to specify the +# directory in which your mail is stored. The 'reference' value will be prefixed +# to all folder paths refering to that repository. E.g. accessing folder 'INBOX' +# with "reference = Mail" will try to access Mail/INBOX. +# +# The nametrans and folderfilter functions will apply to the full path, +# including the reference prefix. Most users will not need this. +# +#reference = Mail + +# This option stands in the [Repository RemoteExample] section. +# # In between synchronisations, OfflineIMAP can monitor mailboxes for new -# messages using the IDLE command. If you want to enable this, specify here -# the folders you wish to monitor. Note that the IMAP protocol requires a -# separate connection for each folder monitored in this way, so setting -# this option will force settings for: -# maxconnections - to be at least the number of folders you give -# holdconnectionopen - to be true -# keepalive - to be 29 minutes unless you specify otherwise +# messages using the IDLE command. If you want to enable this, specify here the +# folders you wish to monitor. IMAP protocol requires a separate connection for +# each folder monitored in this way, so setting this option will force settings +# for: +# +# - maxconnections: to be at least the number of folders you give +# - holdconnectionopen: to be true +# - keepalive: to be 29 minutes unless you specify otherwise # # This feature isn't complete and may well have problems. See the "Known Issues" # entry in the manual for more details. # # This option should return a Python list. For example # -# idlefolders = ['INBOX', 'INBOX.Alerts'] -# +#idlefolders = ['INBOX', 'INBOX.Alerts'] + +# This option stands in the [Repository RemoteExample] section. +# # OfflineIMAP can use a compressed connection to the IMAP server. # This can result in faster downloads for some cases. # #usecompression = yes + +# This option stands in the [Repository RemoteExample] section. +# # OfflineIMAP can use multiple connections to the server in order # to perform multiple synchronization actions simultaneously. # This may place a higher burden on the server. In most cases, # setting this value to 2 or 3 will speed up the sync, but in some # cases, it may slow things down. The safe answer is 1. You should # probably never set it to a value more than 5. - +# #maxconnections = 2 + +# This option stands in the [Repository RemoteExample] section. +# # OfflineIMAP normally closes IMAP server connections between refreshes if # the global option autorefresh is specified. If you wish it to keep the # connection open, set this to true. If not specified, the default is @@ -581,151 +712,185 @@ remoteuser = username # #holdconnectionopen = no -# If you want to have "keepalives" sent while waiting between syncs, -# specify the amount of time IN SECONDS between keepalives here. Note that -# sometimes more than this amount of time might pass, so don't make it -# tight. This setting has no effect if autorefresh and holdconnectionopen -# are not both set. -# -# keepalive = 60 -# Normally, OfflineIMAP will expunge deleted messages from the server. -# You can disable that if you wish. This means that OfflineIMAP will -# mark them deleted on the server, but not actually delete them. -# You must use some other IMAP client to delete them if you use this -# setting; otherwise, the messages will just pile up there forever. -# Therefore, this setting is definitely NOT recommended. +# This option stands in the [Repository RemoteExample] section. +# +# If you want to have "keepalives" sent while waiting between syncs, specify the +# amount of time IN SECONDS between keepalives here. Note that sometimes more +# than this amount of time might pass, so don't make it tight. This setting has +# no effect if autorefresh and holdconnectionopen are not both set. +# +#keepalive = 60 + + +# This option stands in the [Repository RemoteExample] section. +# +# Normally, OfflineIMAP will expunge deleted messages from the server. You can +# disable that if you wish. This means that OfflineIMAP will mark them deleted +# on the server, but not actually delete them. You must use some other IMAP +# client to delete them if you use this setting; otherwise, the messages will +# just pile up there forever. Therefore, this setting is definitely NOT +# recommended for a long term. # #expunge = no + +# This option stands in the [Repository RemoteExample] section. +# # Specify whether to process all mail folders on the server, or only # those listed as "subscribed". # #subscribedonly = no -# You can specify a folder translator. This must be a eval-able -# Python expression that takes a foldername arg and returns the new -# value. I suggest a lambda. This example below will remove "INBOX." from -# the leading edge of folders (great for Courier IMAP users) + +# This option stands in the [Repository RemoteExample] section. # -# See the user documentation for details and use cases. They are also -# online at: +# You can specify a folder translator. This must be a eval-able. +# +# Python expression that takes a foldername arg and returns the new value. A +# lambda function is suggested. +# +# WARNING: you MUST construct it so that it NEVER returns the same value for two +# folders, UNLESS the second values are filtered out by folderfilter below. +# Failure to follow this rule will result in undefined behavior. +# +# See the user documentation for details and use cases. They are also online at: # http://docs.offlineimap.org/en/latest/nametrans.html # -# WARNING: you MUST construct this such that it NEVER returns -# the same value for two folders, UNLESS the second values are -# filtered out by folderfilter below. Failure to follow this rule -# will result in undefined behavior +# This example below will remove "INBOX." from the leading edge of folders +# (great for Courier IMAP users). +# +#nametrans = lambda foldername: re.sub('^INBOX\.', '', foldername) # -# nametrans = lambda foldername: re.sub('^INBOX\.', '', foldername) - # Using Courier remotely and want to duplicate its mailbox naming # locally? Try this: # -# nametrans = lambda foldername: re.sub('^INBOX\.*', '.', foldername) +#nametrans = lambda foldername: re.sub('^INBOX\.*', '.', foldername) -# Determines if folderfilter will be invoked on each run -# (dynamic folder filtering) or filtering status will be determined -# at startup (default behaviour). + +# This option stands in the [Repository RemoteExample] section. # -# dynamic_folderfilter = False +# Determines if folderfilter will be invoked on each run (dynamic folder +# filtering) or filtering status will be determined at startup (default +# behaviour). +# +#dynamic_folderfilter = False -# You can specify which folders to sync using the folderfilter -# setting. You can provide any python function (e.g. a lambda function) -# which will be invoked for each foldername. If the filter function -# returns True, the folder will be synced, if it returns False, it. The -# folderfilter operates on the *UNTRANSLATED* name (before any nametrans + +# This option stands in the [Repository RemoteExample] section. +# +# You can specify which folders to sync using the folderfilter setting. You can +# provide any python function (e.g. a lambda function) which will be invoked for +# each foldername. If the filter function returns True, the folder will be +# synced, if it returns False, it. +# +# The folderfilter operates on the *UNTRANSLATED* name (before any nametrans # translation takes place). # # Example 1: synchronizing only INBOX and Sent. # -# folderfilter = lambda foldername: foldername in ['INBOX', 'Sent'] +#folderfilter = lambda foldername: foldername in ['INBOX', 'Sent'] # # Example 2: synchronizing everything except Trash. # -# folderfilter = lambda foldername: foldername not in ['Trash'] +#folderfilter = lambda foldername: foldername not in ['Trash'] # # Example 3: Using a regular expression to exclude Trash and all folders # containing the characters "Del". # -# folderfilter = lambda foldername: not re.search('(^Trash$|Del)', foldername) +#folderfilter = lambda foldername: not re.search('(^Trash$|Del)', foldername) # -# If folderfilter is not specified, ALL remote folders will be -# synchronized. +# If folderfilter is not specified, ALL remote folders will be synchronized. # -# You can span multiple lines by indenting the others. (Use backslashes -# at the end when required by Python syntax) For instance: +# You can span multiple lines by indenting the others. (Use backslashes at the +# end when required by Python syntax) For instance: # -# folderfilter = lambda foldername: foldername in -# ['INBOX', 'Sent Mail', 'Deleted Items', -# 'Received'] +#folderfilter = lambda foldername: foldername in [ +# 'INBOX', 'Sent Mail', +# 'Deleted Items', 'Received'] - -# You can specify folderincludes to include additional folders. It -# should return a Python list. This might be used to include a folder -# that was excluded by your folderfilter rule, to include a folder that -# your server does not specify with its LIST option, or to include a -# folder that is outside your basic reference. The 'reference' value -# will not be prefixed to this folder name, even if you have specified -# one. For example: -# folderincludes = ['debian.user', 'debian.personal'] +# This option stands in the [Repository RemoteExample] section. +# +# You can specify folderincludes to include additional folders. It should +# return a Python list. This might be used to include a folder that was +# excluded by your folderfilter rule, to include a folder that your server does +# not specify with its LIST option, or to include a folder that is outside your +# basic reference. +# +# The 'reference' value will not be prefixed to this folder name, even if you +# have specified one. For example: +# +#folderincludes = ['debian.user', 'debian.personal'] +# This option stands in the [Repository RemoteExample] section. +# # If you do not want to have any folders created on this repository, # set the createfolders variable to False, the default is True. Using # this feature you can e.g. disable the propagation of new folders to # the new repository. +# #createfolders = True -# You can specify 'foldersort' to determine how folders are sorted. -# This affects order of synchronization and mbnames. The expression -# should return -1, 0, or 1, as the default Python cmp() does. The two -# arguments, x and y, are strings representing the names of the folders -# to be sorted. The sorting is applied *AFTER* nametrans, if any. The -# default is to sort IMAP folders alphabetically -# (case-insensitive). Usually, you should never have to modify this. To -# eg. reverse the sort: +# This option stands in the [Repository RemoteExample] section. # -# foldersort = lambda x, y: -cmp(x, y) +# 'foldersort' determines how folders are sorted. +# +# This affects order of synchronization and mbnames. The expression should +# return -1, 0, or 1, as the default Python cmp() does. The two arguments, x +# and y, are strings representing the names of the folders to be sorted. The +# sorting is applied *AFTER* nametrans, if any. The default is to sort IMAP +# folders alphabetically (case-insensitive). Usually, you should never have to +# modify this. To eg. reverse the sort: +# +#foldersort = lambda x, y: -cmp(x, y) + +# This option stands in the [Repository RemoteExample] section. +# # Enable 1-way synchronization. When setting 'readonly' to True, this -# repository will not be modified during synchronization. Use to +# repository will not be modified during synchronization. Usefull to # e.g. backup an IMAP server. The readonly setting can be applied to any # type of Repository (Maildir, Imap, etc). # #readonly = False + [Repository GmailExample] -# A repository using Gmail's IMAP interface. Any configuration -# parameter of `IMAP` type repositories can be used here. Only -# `remoteuser` (or `remoteusereval` ) is mandatory. Default values -# for other parameters are OK, and you should not need fiddle with -# those. +# A repository using Gmail's IMAP interface. +# +# Any configuration parameter of "IMAP" type repositories can be used here. +# Only "remoteuser" (or "remoteusereval" ) is mandatory. Default values for +# other parameters are OK, and you should not need fiddle with those. +# +# The Gmail repository will use hard-coded values for "remotehost", +# "remoteport", "tunnel" and "ssl". Any attempt to set those parameters will be +# silently ignored. For details, see +# +# http://mail.google.com/support/bin/answer.py?answer=78799&topic=12814 +# +# To enable GMail labels synchronisation, set the option "synclabels" +# in the corresponding "Account" section. # -# The Gmail repository will use hard-coded values for `remotehost`, -# `remoteport`, `tunnel` and `ssl`. (See -# http://mail.google.com/support/bin/answer.py?answer=78799&topic=12814) -# Any attempt to set those parameters will be silently ignored. - type = Gmail + +# This option stands in the [Repository GmailExample] section. +# # Specify the Gmail user name. This is the only mandatory parameter. +# remoteuser = username@gmail.com -# The trash folder name may be different from [Gmail]/Trash -# for example on German Gmail, this setting should be -# -# trashfolder = [Gmail]/Papierkorb -# -# You should look for the localized names of the spam folder too: -# "spamfolder" tunable will help you to override the standard name. -# Enable 1-way synchronization. See above for explanation. +# This option stands in the [Repository GmailExample] section. # -#readonly = False +# The trash folder name may be different from [Gmail]/Trash due to localization. +# You should look for the localized names of the spam folder too: "spamfolder" +# tunable will help you to override the standard name. # -# To enable GMail labels synchronisation, set the option synclabels -# in the corresponding "Account" section. +# For example on German Gmail, this setting should be: +# +#trashfolder = [Gmail]/Papierkorb From 7b2fbeee747c55c40d0e9a34ef54a789cf3510e2 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Wed, 14 Jan 2015 18:00:15 +0100 Subject: [PATCH 12/14] repository: GmailMaildir: fix copyright Signed-off-by: Nicolas Sebrecht --- offlineimap/repository/GmailMaildir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offlineimap/repository/GmailMaildir.py b/offlineimap/repository/GmailMaildir.py index 61352f8..71f89ac 100644 --- a/offlineimap/repository/GmailMaildir.py +++ b/offlineimap/repository/GmailMaildir.py @@ -1,5 +1,5 @@ # Maildir repository support -# Copyright (C) 2002 John Goerzen +# Copyright (C) 2002-2015 John Goerzen & contributors # # # This program is free software; you can redistribute it and/or modify From 6d46070e11ebe488a164417ae4b62df59d85a1c9 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Mon, 12 Jan 2015 17:38:03 +0100 Subject: [PATCH 13/14] MAINTAINERS: add mailing list maintainers Signed-off-by: Nicolas Sebrecht --- MAINTAINERS | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index f237f00..53b54d8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10,10 +10,22 @@ Eygene Ryabinkin email: rea at freebsd.org github: konvpalto +Sebastian Spaeth + email: sebastian at sspaeth.de + github: spaetz + Nicolas Sebrecht email: nicolas.s-dev at laposte.net github: nicolas33 +MAILING LIST MAINTAINERS +======================== + +Eygene Ryabinkin + email: rea at freebsd.org + Sebastian Spaeth email: sebastian at sspaeth.de - github: spaetz + +Nicolas Sebrecht + email: nicolas.s-dev at laposte.net From c5eb4c9432b6b7f2ffe4f3201cea6e703f736f51 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Thu, 15 Jan 2015 11:41:35 +0100 Subject: [PATCH 14/14] COPYING: fix unexpected characters Signed-off-by: Nicolas Sebrecht --- COPYING | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/COPYING b/COPYING index 6526be4..bb94f18 100644 --- a/COPYING +++ b/COPYING @@ -65,7 +65,7 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -120,7 +120,7 @@ above, provided that you also meet all of these conditions: License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -178,7 +178,7 @@ access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -235,7 +235,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -288,7 +288,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest