Commit Graph

2202 Commits

Author SHA1 Message Date
Nicolas Sebrecht 3a5becf6a7 bump from imaplib2 v2.53 to v2.55
- Expose more literals.
- Fix a type to bytes.
- Fix comment.

Changes submitted upstream by Łukasz and me.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-11 11:08:02 +02:00
Nicolas Sebrecht cdfa75f72d offlineimap.conf: minor improvements
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 19:09:57 +02:00
Nicolas Sebrecht e3fe848c6b minor code cleanups
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 19:03:02 +02:00
Nicolas Sebrecht 7fcd160911 GmailMaildir: quick mode is not compatible with utime_from_header
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 19:02:04 +02:00
Nicolas Sebrecht c4c73dd1a0 offlineimap.conf: sync_deletes option is stable
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 18:23:00 +02:00
Nicolas Sebrecht 5783e8f777 offlineimap.conf: fix and improve documentation about TLS/SSL
ssl2 is not allowed by imaplib2. However, tls1_1 and tls1_2 might be available.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 17:34:07 +02:00
Nicolas Sebrecht 8c9f63a9b5 repository/IMAP: add minor comment
Some minor cleanups on whitespaces.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 16:01:58 +02:00
Nicolas Sebrecht 344cc07f7a website-doc.sh: include maintenance releases in the list of announces
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 03:21:28 +02:00
Nicolas Sebrecht 744974584a website-doc.sh: announces.yml: fill the page for the links
This allows tuning of the links when the announce is made in
Changelog.maint.html.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 03:04:10 +02:00
Nicolas Sebrecht 8cca78b265 v6.7.0.1
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 02:02:32 +02:00
Nicolas Sebrecht 3f70d9ef37 sqlite: open database when we use it rather than at instantiation time
Backported from 8e995a69bfa003ab822b55731429d84b3bc5626f.

We currently close the database as soon as possible while we handle the status
backend but this is still too early because autorefresh induces looping on this
code block.

Instead of delaying the closing outside of the loop, it's easier to delay the
opening as late as possible (inside the loop). The downside is that the database
is opened/closed more than once when autorefresh is enabled. The good news is
that this make the code much easier.

Fixes regression introduces by 6fb5700.

Reported-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 01:59:39 +02:00
Nicolas Sebrecht b840e66d59 SQLite: close db when done
Backported from 6fb5700f94.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-08 01:59:14 +02:00
Nicolas Sebrecht cb8678a5b5 Merge tag 'v6.7.0' into maint
v6.7.0
2016-06-08 01:56:21 +02:00
Nicolas Sebrecht effe1d85a8 LocalStatusSQLite: remove dead code: sqlite import fails early
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-07 17:46:18 +02:00
Nicolas Sebrecht feda1f7a53 release.sh: put the authors directly to the AUTHORS section
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-07 17:24:27 +02:00
Nicolas Sebrecht 871d6584f2 release.sh: learn users how to get the requirements file for pip
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-07 17:13:02 +02:00
Nicolas Sebrecht 5e61faac9c move requirements.txt to the root directory
This is where most users expect this file to stand.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-07 17:05:31 +02:00
Nicolas Sebrecht a41fecd057 learn -V CLI option
Help users to get the versions while reporting bugs.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-07 00:36:57 +02:00
Nicolas Sebrecht 19ac578a50 sqlite was made mandatory: import error can fail at import time
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-06 15:18:29 +02:00
Nicolas Sebrecht e8eb596fab README: add imaplib2 dependency and remove libraries in the standard libraries
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-06 15:14:25 +02:00
Nicolas Sebrecht fd0198027a --info displays the imaplib2 version and whether it's the bundled or system one
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-04 15:23:53 +02:00
Nicolas Sebrecht 9902a116c0 init: improve style of code comments
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-04 15:23:51 +02:00
Nicolas Sebrecht 703ac7718d v7.0.0-rc2
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-04 12:45:45 +02:00
Nicolas Sebrecht acc9c3cf49 introduce a virtual imaplib2
The virtual imaplib2 first try to import imaplib2 when provided by the system.
If not provided or if the version is not supported, fallback on the bundled
imaplib2 version.

Distribution maintainers can now easily remove the bundled imaplib2 version if
they want to get it packaged outside of offlineimap.

We still want to provide imaplib2 by default because:
- this library is neither in Python core nor packaged by a lot of distributions;
- users expect to be able to run offlineimap by just downloading the tarball or
  after a git clone.

In order to avoid unexpected (too old) versions of imaplib2, we restrict the
supported versions of this librabry.

Reviewed-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-04 12:17:53 +02:00
Nicolas Sebrecht 922bed05a7 threading: improve comments
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-04 02:25:44 +02:00
Nicolas Sebrecht d848141b39 mark Python 3 supported and experimental
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-03 20:07:15 +02:00
Łukasz Żarnowiecki 1894a8f871 allow to run under python3 without special env
Github-Fix: #81 https://github.com/OfflineIMAP/offlineimap/issues/81
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-03 19:59:56 +02:00
Nicolas Sebrecht 56f473326a bump imaplib2 from v2.52 to v2.53
Be aware upstream has two versions of both 2.52 and 2.53.

This bump change is from

 commit a205409a0047732840505e534c07d8d85d2644a1
 Author: Piers Lauder <piers@janeelix.com>
 Date:   Sun Dec 27 20:55:04 2015 +1100

     Back out BINARY changes - not implemented correctly.

to

  commit 0596e7372fd3556d27ea55510b1e8cfa8370ec43
  Author: Piers Lauder <piers@janeelix.com>
  Date:   Fri Jun 3 11:58:40 2016 +1000

      new version of imaplib2.py

Original-imaplib2-patch-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-03 12:09:40 +02:00
Łukasz Żarnowiecki 48ae1a36c8 maildir: Create top level dir recursively
This patch fixes the situation when "localfolders" specifies path that
is more that one level deep and top directory does not exists.  Example
would be "localfolders = ~/Mail/a".  This especially relevant on the
first run.

In that case we would end up with unhandled exception causing
unexpected termination of the program.

Thread 'Account sync test' terminated with exception:
Traceback (most recent call last):
  File "/offlineimap/offlineimap/threadutil.py", line 172, in run
    Thread.run(self)
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/offlineimap/offlineimap/accounts.py", line 258, in syncrunner
    self.localrepos  = Repository(self, 'local')
  File "/offlineimap/offlineimap/repository/__init__.py", line 82, in __new__
    return repo(name, account)
  File "/offlineimap/offlineimap/repository/Maildir.py", line 40, in __init__
    os.mkdir(self.root, 0o700)
OSError: [Errno 2] No such file or directory: '/Mail/a'

By replacing call to "mkdir" with "makedirs" we can simply create
directories recursively.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-01 19:49:55 +02:00
Nicolas Sebrecht f00cbeed5a IMAP: ignore UID with 0 as value when searching for UIDs
Some servers are broken: they return zero as valid UID and respond "BAD invalid
parameter: 0" on the FETCH command.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-25 03:33:06 +02:00
Nicolas Sebrecht b14f37942a globals: use whitespaces instead of tabs
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-22 23:31:54 +02:00
Nicolas Sebrecht bb1160f0ee minor: fix copyright date
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-20 18:20:07 +02:00
Nicolas Sebrecht c38bd24c80 six: add requirements for pip
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-19 18:38:42 +02:00
Nicolas Sebrecht e34a64a2e7 README: add six library requirement
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-19 09:49:53 +02:00
Nicolas Sebrecht b8c3e51739 v7.0.0-rc1
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-19 09:25:01 +02:00
Nicolas Sebrecht c2d13db61e release.sh: make no differences between contributors
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-19 08:43:13 +02:00
Nicolas Sebrecht a2a8a908ca threading: fix variable names about namespaces
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-19 08:36:23 +02:00
Nicolas Sebrecht 0b32e787c7 imapserver: use boolean where it makes sense
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-19 08:33:14 +02:00
Nicolas Sebrecht 46a6bcbf1c threading: suggeststhreads must honor CLI and conf options
There's no need to honor them twice.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-18 04:23:02 +02:00
Nicolas Sebrecht e0fdcb3852 threading: improve variable names and factorize code
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-18 04:23:02 +02:00
Łukasz Żarnowiecki 0addcbabf0 py3: raise exceptions using six module
There is no other way to make Python2 and Python3 happy, because syntax
raise E, V, T is incompatible with the latter.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-18 01:49:09 +02:00
Nicolas Sebrecht 83539f8601 threading: minor improvements
Factorize string, enhance comments and minor code improvements.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-18 01:32:06 +02:00
Nicolas Sebrecht f93b0963fa instancelimitedsems does not need a lock but must be used with global
All the calls to initInstanceLimit are at initialization time from the same
thread.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-18 01:32:06 +02:00
Nicolas Sebrecht c843f34876 threading: get rid of the syncaccount function
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-18 01:32:06 +02:00
Nicolas Sebrecht 7ab18276f9 get rid of offlineimap/syncmaster.py
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-18 01:32:06 +02:00
Nicolas Sebrecht 857b2f449a threading: rename threadslist to accountThreads
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-18 01:32:06 +02:00
Nicolas Sebrecht 9f8aa38d62 threading: simplify names
Improve comments.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-18 01:32:06 +02:00
Łukasz Żarnowiecki 23f96ba880 Encode utf-8 argument for md5 function
Python3 accepts binary input for md5 function.

This patch is known to break setups using folder names not strictly conforming
the IMAP UTF-7 encoding. We always made it clear that such setup is unsupported
and might be broken at some point in time. See documentation about
'decodefoldernames' in the provided configuration file. This is why this patch
is considered introducing no regression for this use case.

Patches to support both Python 3 and Python 2 by re-encoding the MD5 in the
filenames are welcome. This likely requires a new CLI option to allow
backporting the feature for users downgrading or changing of Python environment.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-17 00:44:02 +02:00
Łukasz Żarnowiecki 2465e1ce6a Replace dictionary iteration methods
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-16 23:18:26 +02:00
Nicolas Sebrecht 05c75e8c8d sqlite: open database when we use it rather than at instantiation time
We currently close the database as soon as possible while we handle the status
backend but this is still too early because autorefresh induces looping on this
code block.

Instead of delaying the closing outside of the loop, it's easier to delay the
opening as late as possible (inside the loop). The downside is that the database
is opened/closed more than once when autorefresh is enabled. The good news is
that this make the code much easier.

Fixes regression introduces by 6fb5700.

Reported-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-12 18:51:59 +02:00