Providing mail.target is really confusing and poor UX:
* When a user enables a unit, it's not truly enabled until they ALSO
enable mail.target. This is very counter-intuitive.
* `mail.target` provides no extra value in itself, nor is it anything
"standard".
* Any user wanting this specific target can still continue using it just
dropping in a `mail.target` file.
Signed-off-by: Hugo Osvaldo Barrera <hugo@barrera.io>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
oneshot units CANNOT have a `Restart=` setting, and including one
invalidates the service file.
Signed-off-by: Hugo Osvaldo Barrera <hugo@barrera.io>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
No need to overcomplicate things; systemd grabs all stdout output and
logs that.
Signed-off-by: Hugo Osvaldo Barrera <hugo@barrera.io>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Add restart on failure and increase timeout to kill service.
Signed-off-by: benutzer193 <registerbn@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Be more obvious that the legacy plain text cache is not supported while we still
support the migration to the sqlite format.
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
On each folder scan, we must compute the min_uid. Locally, this is done by
relying on the prefix timestamp in the filenames. If for whatever reason they do
not reflect the Date header of the email, changing maxage leads to undefined
behaviour.
To prevent from this, we rather rely on the remote folder. We assume that the
remotes are more reliable to provide correct sets of UIDs based on dates than we
are.
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/384
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
mbnames is initialized and written once in the run from OfflineImap.__sync().
However, the in-memory instance is fed with data at sync time for each folder
and the intermediate files are written as soon as all the folders are synced for
the account. All of this is done inside the SyncableAccount.__sync() method
while the syncrunner is looping on this.
This means that we duplicate entries for mbnames in each loop (most likely when
autorefresh is enabled).
It is wrong to have duplicates in mbnames for each account. Ignore duplicates
when adding data in the mbnames intermediate files.
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/467
Reported-and-tested-by: Shin Kojima <shin@kojima.org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
I just went through this whole thing now, wasn't successful because
the referenced oauth tools don't seem to work, but this covers changes
in the Google UI since last time.
Written-By: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Some users might use more than one python/imaplib version. This tends to make
debugging and support harder.
Displaying this information by default for each run should help.
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Checking if we have to run this authentication method once it's already passed
to imaplib2 is too late. Make the checks at correct time, before we try the
authentication method. IOW, before we call
imapobj.authenticate('XOAUTH2', self.__xoauth2handler)
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/442
Tested-by: Klemens Schölhorn <klemens@schoelhorn.eu>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
tls1_2 matches the string in offlineimap/bundled_imaplib2.py and
offlineimap fails when using tls_1_2:
("Invalid SSL version 'tls_1_2' requested for tls_version 'tls_secure'",)
Signed-off-by: Maximilian Kaul <maximilian+git@maximiliankaul.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
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>