Commit Graph

1344 Commits

Author SHA1 Message Date
Ł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
Nicolas Sebrecht
14ef992444 conf: newmail_hook is a remote option
Improve documentation.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-12 18:04:41 +02:00
Nicolas Sebrecht
a1f40af033 threading: simplify the monitoring code for threads
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-12 05:29:49 +02:00
Nicolas Sebrecht
87cf6bda02 threadutil: don't limit the number of threads
With a maxsize to the Queue of threads we are introducing a blocking call while
adding new threads.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-12 04:35:57 +02:00
Nicolas Sebrecht
2611a0ba6a threading: add comments
Simplify the code.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-12 04:35:21 +02:00
Nicolas Sebrecht
bf8bfbc872 folder: utime_from_header is for Maildir only
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-11 04:10:13 +02:00
Łukasz Żarnowiecki
12866f2771 Wrap zip calls with list call
In Python3, zip returns iterator instead of list.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:09 +02:00
Łukasz Żarnowiecki
ca2d85a6dc Remove xreadlines calls
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:09 +02:00
Łukasz Żarnowiecki
5476b68c25 Replace xrange with range
xrange was removed in Python3 while range exists in boths versions.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:09 +02:00
Łukasz Żarnowiecki
a3bd5d4d38 Replace has_key method to "key in dict"
There is no such method in Python3 any more.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:09 +02:00
Łukasz Żarnowiecki
19c43308b9 Change filter with lambda to list comprehension
It is more readable and returns a list therefore it is compatible both
with Python 2 and 3.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:09 +02:00
Łukasz Żarnowiecki
068ac7c410 Replace calls to long with int calls
long was removed from Python3

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:09 +02:00
Łukasz Żarnowiecki
3848bc55f3 Add workaround for string.split for Python3
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:09 +02:00
Łukasz Żarnowiecki
4fbb5640ac Convert basestring to str
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:09 +02:00
Łukasz Żarnowiecki
1fb8ba9631 Rename email.Parser to email.parser
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:09 +02:00
Łukasz Żarnowiecki
b5d9652bc9 Do not mix tabs with spaces
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:09 +02:00
Łukasz Żarnowiecki
c327bec6c8 Convert except X,T to except X as T
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-10 02:53:08 +02:00
Łukasz Żarnowiecki
6b8ee4a183 Handle maxage for davmail correctly
"imapobj.search" returns a list with one string element of numbers
separated by one whitespace character for regular box (GMail, AOL...).
['1 2 3 4 5 6 7 8 9 10 11 12']
But if we would like to sync from Davmail it would return a list of
numbers.
['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'].

The code "return res_data[0].split()" in the first case will return what
we already have when using Davmail, hence only one email will be
fetched.  But if only the first sync would be with maxage the emails
will be removed, because offlineimap will think that they were removed
by us.

The patch distinguishes between syncing with Davmail and regular box and
applies split on the first element only when it finds whitespace
character.  It also handles the case when the first element is empty on
first sync.

Closes #327

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-07 13:29:44 +02:00
Łukasz Żarnowiecki
92e5455eb4 Inform when maxage/startdate is in the future
Sometimes it might happen that you put wrong date and you except emails
to be fetched, but they are not and you do not have an idea why.

By raising exception the user will see a proper message telling that he
used the wrong date for maxage/startdate property.

If someone wants to set a future date intentionally might as well sync
in the future.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-05 23:50:24 +02:00
Nicolas Sebrecht
141abfdf50 don't write a pid file
This was likely used to avoid multiple instances but this is supported for
several years.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-04-26 23:49:45 +02:00
Nicolas Sebrecht
2fb2f840dc XOAUTH2: don't force oauth2_request_url to be defined
Not all users want XOAUTH2.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-04-25 18:38:31 +02:00
Nicolas Sebrecht
2fc5d2a814 XOAUTH2: raise error when oauth_request_url is missing for IMAP type
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-04-25 17:38:42 +02:00
Nicolas Sebrecht
d5853b5d65 learn to not delete messages
This enables the "append" mode feature. Configuration option is sync_deletes in
both local and remote repositories. Marked EXPERIMENTAL and UNTESTED.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-04-09 22:08:28 +02:00
Nicolas Sebrecht
41e275e9a2 make sqlite status cache the default
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-04-09 21:06:38 +02:00
Nicolas Sebrecht
6fb5700f94 SQLite: close db when done
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-04-09 19:55:26 +02:00
Nicolas Sebrecht
1ba5e9160d minor: logs: print readonly message in all debug modes
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-04-09 18:57:00 +02:00
Nicolas Sebrecht
801dda521e accounts.py: minor improvements
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-04-09 18:50:12 +02:00
Nicolas Sebrecht
657f258196 folder: properly factorize initialization and dropping of self.message
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-04-09 18:12:18 +02:00
Nicolas Sebrecht
9486a0dab3 IMAP: don't try to create empty folders
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-04-09 17:35:15 +02:00
Nicolas Sebrecht
8c7a7355a3 v6.7.0
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-03-10 17:08:18 +01:00
Ilias Tsitsimpis
c84d23b656 Identify and fix messages with FMD5 inconsistencies
Introduce the '--migrate-fmd5-using-nametrans' option which migrates the
FMD5 hashes from versions prior to 6.3.5.

It seems that commit 'Apply nametrans to all Foldertypes' (6b2ec956cf)
introduced a regression because it changed the FMD5 part of the filename
calculated by OfflineIMAP. Thus, OfflineIMAP believes that the messages
has been removed and adds them back.

For more information, see:
http://www.offlineimap.org/configuration/2016/02/12/debian-upgrade-from-jessie-to-stretch.html

Bug-Debian: https://bugs.debian.org/812108
Reported-by: François <francois@avalenn.eu>
Signed-off-by: Ilias Tsitsimpis <i.tsitsimpis@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-03-06 21:01:51 +01:00
Ben Boeckel
d8398ba374 Curses, UIBase: remove references to __bigversion__
__bigversion__ was removed in 281bcefb52.

Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-03-05 06:47:24 +01:00
Ebben Aries
9bfd610230 change hard coding of AF_UNSPEC to user-defined address-families per repository
Some environments that return AAAA records for their IMAP servers can pose
problems for clients that do not have end-to-end IPv6 connectivity for a number
of reasons (e.g. policy, lack of full routing, security, etc..)

Even with a fallback mechanism in place, you can still arrive at IMAP
implementations that could prevent authentication from unknown IPv6 space. This
in itself is not enough to fallback to IPv4 since there is an actual connection
on that socket.

This change is for introducing a user-defined value:

  [Repository imap-remote]
  ipv6 = no

to create a preference per repository on which AF to connect to the remote
server on

ipv6 = yes (AF_INET6)
ipv6 = no (AF_INET)
unspecified = default

Signed-off-by: Ebben Aries <e@dscp.org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-02-23 06:57:21 +01:00
Nicolas Sebrecht
893a90c291 v6.7.0-rc2
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-02-22 12:47:42 +01:00
Nicolas Sebrecht
9fe337d4fb fix year of copyright
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-02-22 12:24:15 +01:00
Nicolas Sebrecht
281bcefb52 versioning: avoid confusing pip by spliting out __version__ with __revision__
Python tools are not used to a __revision__.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-02-22 12:14:49 +01:00
Nicolas Sebrecht
36375daee6 fix: exceptions.OSError might not have attribute EEXIST defined
Since this is used in an except calse, we first don't mask the real cause and
raise the original error.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-02-19 12:33:57 +01:00
Nicolas Sebrecht
36165e391f update links to the new URL www.offlineimap.org
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-02-19 12:10:23 +01:00
Ray Song
b670bb2022 XOAUTH2 handler: urlopen with proxied socket
Signed-off-by: Ray Song <i@maskray.me>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-02-15 11:14:50 +01:00
Ilias Tsitsimpis
37bcd45e4e Abort after three Ctrl-C keystrokes
By default, OfflineIMAP catches SIGTERM/SIGHUP/SIGINT and attempts to
gracefully terminate as soon as possible. Allow the user to abort
immediately, by hitting Ctrl-C several times.

Bug-Debian: https://bugs.debian.org/679975
Signed-off-by: Ilias Tsitsimpis <i.tsitsimpis@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-02-04 15:30:14 +01:00
Nicolas Sebrecht
426905ba85 v6.7.0-rc1
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-01-24 19:47:14 +01:00
Nicolas Sebrecht
1553e843b3 Revert "Don't output initial blurb in "quiet" mode"
This reverts commit a1dc76ae91.

Causes a crash when using Blinkenlights UI with -l CLI option.

  $ ./offlineimap.py -c offlineimap.conf.minimal -u blinkenlights -l foo
  Traceback (most recent call last):
    File "./offlineimap.py", line 36, in <module>
      oi.run()
    File "/tmp/offlineimap/offlineimap/init.py", line 50, in run
      options, args = self.__parse_cmd_options()
    File "/tmp/offlineimap/offlineimap/init.py", line 205, in __parse_cmd_options
      self.ui.setlogfile(options.logfile)
    File "/tmp/offlineimap/offlineimap/ui/UIBase.py", line 119, in setlogfile
      self.logger.info(msg)
    File "/usr/lib/python2.7/logging/__init__.py", line 1159, in info
      self._log(INFO, msg, args, **kwargs)
    File "/usr/lib/python2.7/logging/__init__.py", line 1278, in _log
      self.handle(record)
    File "/usr/lib/python2.7/logging/__init__.py", line 1288, in handle
      self.callHandlers(record)
    File "/usr/lib/python2.7/logging/__init__.py", line 1328, in callHandlers
      hdlr.handle(record)
    File "/usr/lib/python2.7/logging/__init__.py", line 751, in handle
      self.emit(record)
    File "/tmp/offlineimap/offlineimap/ui/Curses.py", line 305, in emit
      color = self.ui.gettf().curses_color
  AttributeError: 'CursesLogHandler' object has no attribute 'ui'

Reported-by: iliastsi
Github-issue: #293
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-01-08 17:33:00 +01:00
ojab
cfa704bbf2 Allow authorization via XOAUTH2 using access token
Signed-off-by: Slava Kardakov <ojab@ojab.ru>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-12-30 00:25:57 +01:00
Nicolas Sebrecht
7ed71fa742 v6.6.1
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-12-28 01:32:37 +01:00
Nicolas Sebrecht
c8a511bb7e bump imaplib2 from 2.52 to 2.53
Remove support for binary send.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-12-28 01:18:16 +01:00
Nicolas Sebrecht
452ada330a folder/Maildir: ignore dot files
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-12-05 12:49:41 +01:00
Nicolas Sebrecht
4a06c2af24 v6.6.0
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-12-05 00:39:43 +01:00
Nicolas Sebrecht
02a5f77780 bump imaplib2 from v2.52 to v2.53
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-28 23:38:22 +01:00
Valentin Lab
f2ca4217c6 fix: broken retry loop would break connection management
The retry loop would release connection that would get
re-released upon ``finally`` clause. In consequence, an
exception would be cast.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-26 17:11:59 +01:00
Nicolas Sebrecht
5e0f733c3e Merge branch 'ia/maildir-keywords' into next 2015-11-22 20:06:43 +01:00
Nicolas Sebrecht
d6077a09cf Keywords: avoid warning at each message when no keywords are used
This fix does not apply when any keyword in configured which is already
harmless.

Written-by: Igor Almeida <igor.contato@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-22 20:05:34 +01:00
Igor Almeida
58a6f8b401 __syncmessagesto_flags: refactor for readability
Extract the flag/keyword translation and combination logic to a
function.

Signed-off-by: Igor Almeida <igor.contato@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-22 19:51:33 +01:00
Igor Almeida
61ee6e783e __syncmessagesto_flags: store keywords
This uses the destination folder's keyword mapping to translate the
message's keywords into some appropriate format.

Tested only with local Maildir.

Signed-off-by: Igor Almeida <igor.contato@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-22 19:51:20 +01:00
Igor Almeida
73a3767d11 IMAP folder: expose the message keywords
The keywords are in the flag string, so imaputil can just strip the
usual \Flags.

Signed-off-by: Igor Almeida <igor.contato@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-22 19:51:02 +01:00
Igor Almeida
4e2de8f58a Maildir repository: add config keys for IMAP keywords
This commit assembles a dictionary mapping user-specified IMAP keywords
to Maildir lower-case flags, similar to Dovecot's format
http://wiki2.dovecot.org/MailboxFormat/Maildir

Configuration example:

[Repository Local]
type = Maildir
localfolders = ~/Maildir/
customflag_a = $label1
customflag_b = $Forwarded
customflag_c = Junk

Signed-off-by: Igor Almeida <igor.contato@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-22 19:50:43 +01:00
Igor Almeida
c52ca66874 Maildir folder: extract lower-case letters (custom flags) from filename
Remove filtering that was previously done to avoid errors in flag
handling.

Signed-off-by: Igor Almeida <igor.contato@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-22 19:50:22 +01:00
Valentin Lab
6a6b01f1a1 fix: replace rogue print statement by self.ui.debug
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-09 11:47:39 +01:00
Nicolas Sebrecht
c5c45cc687 minor: add parenthesis to print in init
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-09 04:40:05 +01:00
Valentin Lab
4087f3a4e7 add a full stack of all thread dump upon EXIT or KILL signal in thread debug mode
Note that the stacks are grouped if similar, and the current
process (the one handling the signal) is identified and reports
where it was before the signal.

This can be quite handy when wanting to debug thread locks for
instance.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-09 04:39:42 +01:00
Nicolas Sebrecht
86a91f28c0 v6.6.0-rc3
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-05 09:26:01 +01:00
Nicolas Sebrecht
04babea607 bump from imaplib2 v2.51 to v2.52
Thanks-to: Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-05 09:07:31 +01:00
Nicolas Sebrecht
74e5ff5785 Merge branch 'renard-timestap-maildir' into next 2015-11-04 10:37:57 +01:00
Valentin Lab
b2adf2d258 fix: avoid writing password to log
Github-fix: #266
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-04 08:00:50 +01:00
Sébastien Gross
3b30c4aa93 add new config option filename_use_mail_timestamp
If this value is true, use (if possible) a timestamp based on message
Date or Delivery-date headers. The current system time is used
otherwise.

filename_use_mail_timestamp and utime_from_header are now completely
separated option that do not interfere one with other.

To handle this feature in a multithread context we use a hash to count
the number of mail with the same timestamp. This method is more accurate
than using the old lasttime and timeseq variables.

Signed-off-by: Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-11-04 00:56:46 +01:00
Max Vilimpoc
1becbff786 enable SSL by default
Fix-github-issue: #263
Signed-off-by: Max Vilimpoc <github@vilimpoc.org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-29 16:13:44 +01:00
Nicolas Sebrecht
b7fec93661 v6.6.0-rc2
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-15 04:55:34 +02:00
Nicolas Sebrecht
91d089641b bump imaplib2 from v2.50 to v2.51
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-15 04:15:37 +02:00
Nicolas Sebrecht
2a637bd457 bump impalib2 from v2.49 to v2.50
Allows ssl3 protocol to not be available.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-13 14:37:43 +02:00
Nicolas Sebrecht
63db8776e0 Noninteractive: add minor comment
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-13 00:52:43 +02:00
Ben Boeckel
e18428b25b UIBase: add a syslog ui
Rather than having an option for syslog output, make a separate UI
option.

Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-13 00:48:18 +02:00
Nicolas Sebrecht
3daddb9b33 folder/IMAP: minor indent fix
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-13 00:45:51 +02:00
Ben Boeckel
428bb77984 Noninteractive: fix docstring for Basic
Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-13 00:40:27 +02:00
Janna Martl
ee0de28cc4 utime_from_header: handle out-of-bounds dates
Handle case where email's internal time is erroneously so large as to
cause overflow errors when setting file modification time with
utime_from_header = true.

Reported-by: Cameron Simpson <cs@zip.com.au>
Signed-off-by: Janna Martl <janna.martl109@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-12 16:19:23 +02:00
Ben Boeckel
f03afcd224 imapserver: add a tls_level option
Allow the user to block usage of known-bad versions of SSL and TLS.

Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-12 15:54:15 +02:00
Nicolas Sebrecht
9bb27de375 do use the XOAUTH2 url if configured
fix regression introduced by af640208e1.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-12 07:51:05 +02:00
Nicolas Sebrecht
af640208e1 make XOAUTH2 configuration option optional
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-12 07:42:30 +02:00
Nicolas Sebrecht
ebb2124dbb Merge branch 'Frizlab-gmail-oauth-2' into next 2015-10-06 14:25:15 +02:00
Christopher Corley
f7efaa2093 learn XOAUTH2 authentication
Signed-off-by: François Lamboley <francois.lamboley@happn.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-10-06 14:24:42 +02:00
Nicolas Sebrecht
cc3cbaea05 bump imaplib2 from v2.48 to v2.49
Includes changes to new TLS option.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-09-30 13:29:59 +02:00
Prashant Sachdeva
2f1c856c04 fix status code to reflect success or failure to sync
Return value set to 1 if sync failed and error is thrown. Otherwise set to 0 if successful.

Signed-off-by: Prashant Sachdeva <sachdevp@cs.ubc.ca>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-09-29 08:31:46 +02:00
Nicolas Sebrecht
fb12fc1975 v6.6.0-rc1
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-09-28 03:09:43 +02:00
Nicolas Sebrecht
f591fe66cc Merge branch 'mathstuf-syslog-logging' into next 2015-09-27 04:14:54 +02:00
Ben Boeckel
585e5d5e2e logging: add a switch to log to syslog
Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-09-27 04:12:33 +02:00
Nicolas Sebrecht
71dd03e88c Bump imaplib2 from 2.43 to 2.48
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-09-14 14:56:17 +02:00
Nicolas Sebrecht
55ca922dd1 Merge branch 'krafczyk-new-mail-hook-2' into next 2015-09-11 21:04:52 +02:00
Matthew Krafczyk
48bb2f4113 Added the newmail_hook
When new mail arrives, this hook is triggered, allowing the user to
play a sound, or launch a popup.

Signed-off-by: Matthew Krafczyk <krafczyk.matthew@gmail.com>
2015-09-11 20:34:38 +02:00
Nicolas Sebrecht
ebf9e24f87 Merge branch 'fix/225' of git://github.com/milouse/offlineimap into milouse-fix/225 2015-09-04 15:50:58 +02:00
Étienne Deparis
41692d0328 Try to fix #225 « Runonce (offlineimap -o) does not stop if autorefresh is declared in DEFAULT section »
Signed-off-by: Étienne Deparis <etienne@depar.is>
2015-09-04 12:12:28 +02:00
Tommie Gannert
a6e7b6627b Add decodefoldernames option to decode IMAP folder names using UTF-7.
Signed-off-by: Tommie Gannert <tommie@gannert.se>
2015-08-29 16:43:33 +01:00
Nicolas Sebrecht
ca1ce256ec v6.5.7
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-05-15 15:20:18 +02:00
Alex Kapranoff
07af72081a report UID validity problem in exit code
Since skipping a folder means no new data is downloaded, the UID validity
problem is a backup failure. Make it possible to alert or work around
it in scripts by signaling with the exit code.

Signed-off-by: Alex Kapranoff <alex@kapranoff.ru>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2015-05-11 14:38:31 +02:00