Updated bundled imaplib2 to 2.35:

 - Fix for Gmail sending a BYE response after reading >100 messages
   in a session.

 - Includes fix for GitHub#15: patch was accepted upstream.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Updated bundled imaplib2 to 2.36

2.36 it includes support for SSL version override that was integrated
into our code before, no other changes.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Fix parsing of quoted strings

When imaputil was parsing quoted strings, it treated "abcd\\"
as incomplete quoted string having escaped quote, rather than
properly-quoted string having escaped backslash.

GitHub issue: https://github.com/OfflineIMAP/offlineimap/issues/53
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Rolling in release candidate #3 for 6.5.5

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
OfflineIMAP 6.5.5 is out

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
change_message_uid did not update messagelist's filename

This broke code that relied on the filename being up to date in memory after
messages are copied.
Changed NotImplementedException to NotImplementedError

It seems NotImplementedException does not exist. It must be a relic from old
python...
Enable compressed connections to the IMAP server

Added the configuration setting usecompression for the IMAP repositories.
When enabled, the data from and to the IMAP server is compressed.
Restructured folder.IMAP code

Preparing for a sequence of commits implementing gmail label sync, I have split
some functions so I will be able to change some functionality in folder.Gmail,
with less code repetition.

Also added some functions to folder.base and imaputil I will later need.
Adds labels and mtime to LocalStatus Sqlite table

Adds two columns to the LocalStatus Sqlite table:
  * labels: A comma separated list of labels, to be used by Gmail folder.
  * mtime: The POSIX modification time for the message in a local Maildir.

The interface for the class LocalStatusSQLite remains compatible with what it
was (i.e. new arguments to functions are optional with default values).
Make GmailFolder sync gmail labels

When synclabels config flag is set to "yes" for the gmail repo, offlineimap
fetches the message labels along with the messages, and embeds them into the
body under the header X-Keywords, as a comma separated list.

The configuration option labelsheader allows to change that header under which
labels are stored. X-Keywords is a useful choice as some mail programs may
recognize it.

It also adds an extra pass to savemessageto, that performs label synchronization
on existing messages from gmail to local, the same way it is done with flags.

The ignorelabels configuration seting contains is a list of comma separated
labels that will be left alone. They will not be added nor removed from any
message.
Implements a GmailMaildir repository

The GmailMaildir repository adds functionality to change message labels. Also
keeps track of messages modification time, so that it can quickly detect when
the labels may have changed.
Added a filterheaders option

When filterheaders is set to a comma-separated list of headers, offlineimap
removes those headers from messages before uploading them to the server.
Update documentation with the recent gmail changes
fixed re.sub call, that was using python 2.7 features.
fixes setting labels on new local messages

This fixes a bug, that would crash offlineimap when:
  - synclabels is enabled
  - there is a new local message not present on gmail
  - the new local message has embedded labels

In this case, the label sync would use the wrong uid and crash. In particular,
this happens when moving messages between different folders "the IMAP way",
instead of changing labels.
Better handling of gmail labels header

In particular, now formats X-Label and Keywords as a space separated list
instead of comma separated list.
fixes header manipulation function

Corrects behaviour of addheader when the message has no '\n\n' separating
headers from content (it may happen with empty content).
fix message_addheader again

A newline was missing when there is no '\n\n' and adds the header at the
beginning.
Don't use gmail's IMAP extensions for the IMAP folder

A query for X-GM-LABELS had slipped in commit 6ecdfc4c993b9003.