Trade recursion by plain old cycle

We can do a simpler and more stack-friendly hack for IMAP
servers with limited line lenghts.

Reported-by: Josh Berry, https://github.com/josh-berry
GH: https://github.com/OfflineIMAP/offlineimap/pull/100
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Avoid copying array every time, just slice it

Suggested-by: Josh Berry
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Create SQLite DB directory if it doesn't exist yet

Also check if DB path doesn't point to a directory.

By: Nick Farrell
GitHub: https://github.com/OfflineIMAP/offlineimap/pull/102
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Properly manipulate contents of messagelist for folder

Create initializer function that puts default values to all fields
of message list item.  Fix all code that directly assigns some hash
to the elements of messagelist: for direct assignments only initializer
is now permitted, all other modification are done in-place.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Fix label processing in GmailMaildir

Commit 7df765cfdb4096a33f35bf709db6820a6c2c79fd introduced regression:
GmailMaildir caches labels in its own function and it was testing the
presence of the 'labels' key in message descriptor.  But 7df765cf
changed descriptor initialization and this key is always present.

So now we have 'labels_cached' flag that tells us if labels were
already cached or not.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Merge branch 'next'
Add support for OS-specific CA bundle locations

GitHub pull: #19
Suggested-by: Michael Vogt <mvo@ubuntu.com>
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Add the OpenSSL exception

The GNU GPL and the OpenSSL license are incompatible. Some distributions
take a hardline stance and do not consider OpenSSL to be a systems library
(which would permit the usage/distribution of OpenSSL) when distributing
apps such as OfflineImap from the same repository. In order to solve these
distributions dilemma, we add the OpenSSL exception to our GNU GPL v2+ license.
This allows for unambiguous use/distribution of our GNU GPL'ed application
with a python linking to openssl.

Consent of all contributors has been requested via email by
Sebastian@SSpaeth.de. With very few exceptions of minor contributions (which
might or might not by copyright-worthy) all past contributors have consented
to adding the OpenSSL exception. None of the replying authors has disagreed
with adding the exception.

The corresponding issues at question:
 https://github.com/OfflineIMAP/offlineimap/issues/104
 Debian bug #747033

We are still missing consent from:
1	Asheesh Laroia
2	Bart Kerkvliet
4	Daniel Burrows
5	David Favro
1	David Logie
1	Eric Dorland
1	Ethan Schoonover
49	Eygene Ryabinkin
1	Loui Chang
1	Luca Capello
1	Michael Witten
2	Mike Dawson
1	Peter Colberg
1	Scott Henson
1	Tom Lawton
1	W. Trevor King
2	X-Ryl669
1	buergi
2	dtk
5	mj

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Merge pull request #115 from spaetz/opensslexception

Add the OpenSSL exception
Properly capitalize OpenSSL

And I am also not against this change in licensing.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Fix warning processing for MachineUI

Old code were trying to pass the message to be output as-is,
but it should really be passed as the 'mesg' key in order to
be properly processed by MAchineLogFormatter.format().

GitHub pull: https://github.com/OfflineIMAP/offlineimap/pull/64
GitHub pull: https://github.com/OfflineIMAP/offlineimap/pull/118
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Announce addition of OpenSSL license exception in ChangeLog

Someone is probably picky about licensing, so allow them to
discover the recent change (provided that they read change logs).

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Merge commit '818486283ed2ccf55e9a0d6be8a1acd8727fb69e'

Testing in "next" revealed no problems (yet).

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Merge branch 'next'

All current changes in next received some testing and no regressions
were spotted.  Make them to receive beating from people running "master".
Add OpenBSD default CA certificates file location

GitHub pull: https://github.com/OfflineIMAP/offlineimap/pull/120
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Add default CA bundle location for DragonFlyBSD

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Brought CustomConfig.py into more proper shape

 - Multi-line documentation for functions and methods
   now has ending triple-double-quotes on an own line,
   as per PEP 257.

 - Added documentation and comments to almost all functions
   and methods.

 - Added stub implementations for getconfig() and getsection()
   inside CustomConfig.ConfigHelperMixin to provide sane
   run-time diagnostics for classes that doesn't implement them.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Merge branch 'next'
Expand the env variable when taking the value of the python file.
Expand the env variables when taking the value of the cacertfile