Make sure that we refresh the screen atomically, since the emit()
function may be called by more that one threads at a time.
Also, modify the draw_bannerwin() method which used to fail in case the
window would become too small. Make sure that the provided offsets to
the window.addstr() method are properly bounded.
Closes#160: blinkenlights display is broken
Tested-by: Cyril Brulebois
Tested-by: Gaudenz Steinlin
Signed-off-by: Ilias Tsitsimpis <i.tsitsimpis@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
I've decided to remove the historical and emblematic excerpt:
> It is fast.
> It is reliable.
> It is flexible.
> It is safe.
Not because we don't match them anymore but because there are known competitive
alternatives nowadays.
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Stop the run when this option is found. Migrating from the historical plain
text status cache is still supported.
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This would require more digging to understand how this is possible. I suspect
that a previous run has been interrupted.
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/445
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Use a mutex to lock the sync transaction, uniquely identified by the remote
folder name.
Serializing the syncs prevents any IDLE thread from syncing the same folder of
a concurrent autorefresh thread. Othewise, we could download new messages
twice, or read "one message past the last one" which in some cases creates a
duplicated messages. Also prevents IDLE threads from reading new messages
before the autorefresh thread finishes synchronization.
Github-ref: #421
Originally-submitted-by: Michael Hohmuth <hohmuth@sax.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
According to documentation and the code, the following behavior is expected:
ipv6 = no
AF_INET is used
ipv6 = yes
AF_INET6 is used
ipv6 undefined
AF_UNDEF is used
Unfortunately the code parsing the "ipv6" configuration option was
returning "False" rather than "None" when failing to locate the option,
making it impossible to detect whether "ipv6" isn't set or if it was set
to "false" and leading offlineimap to use AF_INET for the connection.
This fixes the use of offlineimap on hosts that occasionaly are
connected to IPv6-only networks.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
The saveall() method must acquire the lock to make writes.
Reported-and-tested-by: Julien Cubizolles <j.cubizolles@free.fr>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
We currently propagate the deletions if:
- the content of a folder was deleted;
- the parent directory of the folder was deleted.
The second case in incorrect and unexpected. This requires further work.
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/426
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
systemd supports a watchdog (via the WatchdogSec service file option)
which will send the program a SIGABRT when the timer expires, however
currently this causes offlineimap to be killed immediately.
This patch registers SIGABRT and handles it in the same manner as
SIGUSR2, so that the current synchronisation is completed before the
program exits safely.
This makes offlineimap more flexible and robust for persistent setups
that make use of holdconnectionopen and autorefresh options.
For example, it may be useful in assisting with the occasional
situation where offlineimap may not return successfully after a suspend
and resume.
To make use of this, users could add the following to the [Service]
section of their systemd offlineimap service file (restart every 5
minutes):
Restart=on-watchdog
WatchdogSec=300
Signed-off-by: Chris Smart <mail@csmart.io>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Allow retrying the download of messages more than twice.
Signed-off-by: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Allow to use a another proxy for authentication than for IMAP.
Signed-off-by: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Commit e51ed80e claims to add tilde and environment variable expansion
to multiple locations including Repository.localfolders. However, this
particular options seems to have been missed in that commit, and
apparently no one noticed till date
Signed-off-by: Darshit Shah <darnir@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
481efa95f6 is wrong to assume the local nametrans is set up and working.
Now, we correctly check that the local folder name is the same once both
nametrans are applied to itself. This check is only done when we have to create
the folder on remote.
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/413
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>