Compare commits

...

31 Commits

Author SHA1 Message Date
Chris Coleman ffbace51a2
Update BACKERS.md 2023-03-30 07:19:04 -04:00
Chris Coleman 7eacce1f58
Update BACKERS.md
Add logo (in feature branch of website, pending merge) with link to sponsor website!
2023-03-29 07:00:35 -04:00
Chris Coleman 87b04f0f54
Update BACKERS.md 2023-03-29 04:39:47 -04:00
Chris Coleman 8bd94ee8bc
Create BACKERS.md
Work in Progress. 
For all Bronze and Silver Sponsors, this page is supposed to show sponsoring company logo and link to sponsoring company website, also for Silver, same on sponsors page of our website.
Gold and Platinum go in `README.md` and on front page of our website.
2023-03-29 04:35:40 -04:00
Nicolas Sebrecht e70d3992a0 README: rewording and typo fix
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2021-08-03 01:24:07 +02:00
Nicolas Sebrecht 99a7f74805 Changelog: fix version
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2021-08-03 01:12:52 +02:00
Nicolas Sebrecht 6e837c614d v7.3.4
Tested-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2021-08-03 01:07:23 +02:00
Nicolas Sebrecht 1953001196 Merge remote-tracking branch 'OfflineIMAP/master' into next 2021-08-03 01:06:07 +02:00
Nicolas Sebrecht a4ee6675ce redirect the users to offlineimap3
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2021-08-03 00:55:07 +02:00
Nicolas Sebrecht a2a92e7433 remove outdated links to travis
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2021-08-03 00:54:44 +02:00
Nicolas Sebrecht feec770809
Merge pull request #698 from cathalgarvey/patch-1
Lack of Python 3 support needs to be more clear..
2021-07-29 01:24:24 +02:00
Cathal Garvey 069c05a0c2
Lack of Python 3 support needs to be more clear..
I saw the top line, and the requirement for `six`, and took that to mean that Python 3 was supported. After wasting some of my time setting up and dealing with opaque bugs, I discovered that Python 3 is not supported after all.

"2.7+" implies modernity, so I'm suggesting we substitute "2.7.x" to be explicit that this is Python 2 only, and strike through the Python 3 line to be blunt that it is not working.
2021-05-18 13:07:55 +01:00
Nicolas Sebrecht 2d0d07cd6a README: update regarding the offlineimap3 fork
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/670
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-09-05 01:23:38 +02:00
Rodolfo García Peñas (kix) 595b814074 ui init is lintian clean
This patch only adds an space between the hash and the first character.

Backported from:
a88a9cf28e

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-08-29 23:23:28 +02:00
Rodolfo García Peñas (kix) 2722234d16 threadutil imports not used
These imports are not used.

Backported from:
a655fa4fc2

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-08-29 23:23:28 +02:00
Rodolfo García Peñas (kix) 3d925b006a Changed wrong comparison equal
Backported from:
e84e932df4

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-08-29 22:54:15 +02:00
Rodolfo García Peñas (kix) c7cb68ad7f Comparison error
Backported from:
75ce6e71f3

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-08-29 22:53:16 +02:00
Reto Schnyder f6935342c2 Fix hooks for IDLE sync
`presynchook` and `postsynchook` for IDLE-triggered syncs were broken by
da69fd8. This fixes them.

Signed-off-by: Reto Schnyder <reto.a.schnyder@bluewin.ch>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-08-22 01:54:48 +02:00
Nicolas Sebrecht 21332efb08 folder: IMAP: fix issue when the response of searchforheaders is the same UID multiple times
When the IMAP server doesn't support the UIDPLUS extension so we fallback on the
internal legacy way of mapping the UID to the uploaded message (with the email
header). If the server responds with 2 UIDs offlineimap doesn't know which one
is correct and reports an error.

If for some reason all the returned UIDs are equals it's very likely fine to
map either one.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Tested-by: https://github.com/mpsq
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/676
2020-07-22 22:31:01 +02:00
Nicolas Sebrecht fdb9974ab7 contrib/release..py: the version information has moved to offlineimap.version
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-04-22 16:07:20 +02:00
Martin Di Paola c13e0135a7 Require the minimal dependencies in python package
When an user installs offlineimap from PyPI using pip, the dependencies
of offlineimap are not installed automatically. See #661.

Requiring explicitly the dependencies in the setup.py adds them in the
metadata of the package so pip can install them next with offlineimap.

To avoid duplicated dependencies, requirements.txt delegates to setup.py
the listing of the minimal dependencies while also adding two more
optional dependencies.

Signed-off-by: Martin Di Paola <martinp.dipaola@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-04-22 15:51:13 +02:00
Martin Di Paola 8599cab2ab Move out pkg attributes from __init__.py
The setup.py uses the version, author and others attributes as metadata
for the python package.

The setup read them from offlineimap/__init__.py doing an import of the
module first.

Unfortunately the import also try to import all the dependencies of
offlineimap which may not be installed by the time. See #661.

Moving out the attributes in a separated module allows to be imported by
setup.py whitout needing to import the whole offlineimap.

The import of test.OLItest has the same limitation. In this case the
import was delayed until the real test case run is executed avoiding
again loading offlineimap from the begin.

Signed-off-by: Martin Di Paola <martinp.dipaola@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-04-22 15:51:13 +02:00
Nicolas Sebrecht 7531ac4640 v7.3.3
Tested-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-04-11 01:09:25 +02:00
Herton R. Krzesinski 6a25f1930c Fix stale gss api authentication security context
Inside __authn_gssapi function, the else clause is never executed
because the return statement in the try section, which means if there is
an error and a reconnect is tried, the authentication will now fail with
due the stale self.gss_vc value. For example, offlineimap will be
stuck after any socket error and unable to reconnect, even if I have a
valid kerberos ticket:

========================================================================
abort: command: FETCH => socket error: <type 'exceptions.IOError'> - Too many read 0

  command: FETCH => socket error: <type 'exceptions.IOError'> - Too many read 0
 GSSAPI authentication failed: AUTHENTICATE command error: BAD ['AUTHENTICATE aborted']. Data: BLMC2 AUTHENTICATE GSSAPI

Enter password for user 'XXX':
========================================================================

You can verify this try..finally behaviour with this slightly modified
example that I copied from python documentation:

>>> def divide(x, y):
...     try:
...         result = x / y
...         return 1
...     except ZeroDivisionError:
...         print("division by zero!")
...     else:
...         print("result is", result)
...     finally:
...         print("executing finally clause")
...
>>> divide(2, 1)
executing finally clause
1
>>>

The else section is never executed with a return inside try.

To fix the issue here, instead of relying on else clause, just clear
gss_vc always inside finally, and we don't need to handle any exception
to set self.gssapi, it can be left False by default and just set to True
after authentication is done.

I'm running with this fix and now offlineimap doesn't stop requiring manual
intervention, and succesfully re-authenticate after errors while fetching
data.

Signed-off-by: Herton R. Krzesinski <herton@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-04-11 01:01:44 +02:00
Frank LENORMAND da69fd81ed export env. variables when running account hooks
This commit allows account hooks (pre/post sync) to access contextual
information:

* `OIMAP_ACCOUNT_NAME`: name of the account being synchronized
* `OIMAP_HOOK_NAME`: name of the hook being run (one of `postsynchook`, `presynchook`)

These variables allow using the same hook program (e.g. a script) for
all account synchronisation operations, and running different commands
depending on the stage of the synchronisation or the target account.

Signed-off-by: Frank LENORMAND <lenormf@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-03-23 23:01:30 +01:00
martin f. krafft 4562b1c5d1 exec() the tunnel command
There is no reason that the shell invoking the tunnel command needs to stay
around. Using `exec` to replace the parent with the tunnel command works just
fine and results in a cleaner process table.

Sent-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-03-22 09:02:41 +01:00
Chris Coleman 84efb45270 Handle [ALREADYEXISTS] and Mailbox already exists!
Make compatible with IMAP servers that give the reason code "[ALREADYEXISTS]"
and IMAP servers that give natural language reason "Mailbox already exists!" by
searching for the two words "already" and "exists" in the exception reason
string.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2020-02-06 19:10:33 +01:00
Nicolas Sebrecht 564930725e v7.3.2
Tested-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2019-12-17 20:01:18 +01:00
Nicolas Sebrecht 1e4990524e Revert "fix check for unsupported sep character"
This reverts commit 4208fd4a15.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2019-12-17 19:58:53 +01:00
Chris Coleman 50cfab5ba2
Merge pull request #639 from svetlemodry/arch-linux-name
Fixing the Arch Linux name in README.md
2019-12-16 13:28:25 -05:00
Jaroslav Lichtblau 3c80607907 Fixing the Arch Linux name
according to the naming convention as described in the wiki:
https://wiki.archlinux.org/index.php/Arch_terminology#Arch_Linux
2019-12-16 18:24:15 +01:00
16 changed files with 238 additions and 91 deletions

24
BACKERS.md Normal file
View File

@ -0,0 +1,24 @@
### Many thanks to our wonderful Sponsors! Your generous support helps us maintain OfflineIMAP.
<!-- PLATINUM sponsors: in the README.md and on the front page of website -->
<!-- https://shields.io/opencollective/tier/offlineimap-organization/12940 -->
<!-- GOLD sponsors: in the README.md and on the front page of website -->
<!-- https://shields.io/opencollective/tier/offlineimap-organization/12941 -->
# SILVER sponsors <!-- here and on sponsors page of website -->
<!-- https://shields.io/opencollective/tier/offlineimap-organization/12942 -->
[![silver-zeronet-logo]][silver-zeronet-link]
![Silver Sponsors][silver]
# BRONZE sponsors <!-- here only -->
<!-- https://shields.io/opencollective/tier/offlineimap-organization/12873 -->
![Bronze Sponsors][bronze]
<!-- links / references -->
[silver]: https://opencollective.com/offlineimap-organization/tiers/silver-sponsor.svg "Our Silver Sponsors"
[silver-zeronet-logo]: https://github.com/OfflineIMAP/offlineimap.github.io/raw/master/assets/img/sponsors/zeronet.svg
[silver-zeronet-link]: https://zeronet.co.nz/ "Zeronet - naturally fast internet"
[bronze]: https://opencollective.com/offlineimap-organization/tiers/bronze-sponsor.svg "Our Bronze Sponsors"

View File

@ -15,6 +15,110 @@ Note to mainainers:
* The following excerpt is only usefull when rendered in the website.
{:toc}
### OfflineIMAP v7.3.4 (2021-08-03)
#### Notes
The release is likely the last minor release. This project will be maintained
for minor bug fixes only.
In this version we've backported patches from the offlineimap3 project. There's
no new features. Users should try this fork. The official project is there and
is maintained by Rodolfo:
https://github.com/OfflineIMAP/offlineimap3
This release was tested by:
- Nicolas Sebrecht
#### Authors
- Nicolas Sebrecht (5)
- Rodolfo García Peñas (kix) (4)
- Martin Di Paola (2)
- Reto Schnyder (1)
#### Fixes
- folder: IMAP: fix issue when the response of searchforheaders is the same UID multiple times. [Nicolas Sebrecht]
- Fix hooks for IDLE sync. [Reto Schnyder]
- Changed wrong comparison equal. [Rodolfo García Peñas (kix)]
- Comparison error. [Rodolfo García Peñas (kix)]
- remove outdated links to travis. [Nicolas Sebrecht]
- ui init is lintian clean. [Rodolfo García Peñas (kix)]
- Require the minimal dependencies in python package. [Martin Di Paola]
#### Changes
- README: update regarding the offlineimap3 fork. [Nicolas Sebrecht]
- redirect the users to offlineimap3. [Nicolas Sebrecht]
- threadutil imports not used. [Rodolfo García Peñas (kix)]
- Move out pkg attributes from __init__.py. [Martin Di Paola]
### OfflineIMAP v7.3.3 (2020-04-11)
#### Notes
Here is a small release after nearly 4 months of slow moves. Still, the patches
are very usefull for some use cases. Thanks to the contributors!
This release was tested by:
- Nicolas Sebrecht
#### Authors
- Chris Coleman (1)
- Frank LENORMAND (1)
- Herton R. Krzesinski (1)
- martin f. krafft (1)
#### Features
- export env. variables when running account hooks. [Frank LENORMAND]
#### Fixes
- Fix stale gss api authentication security context. [Herton R. Krzesinski]
- Handle [ALREADYEXISTS] and Mailbox already exists!. [Chris Coleman]
#### Changes
- exec() the tunnel command. [martin f. krafft]
### OfflineIMAP v7.3.2 (2019-12-17)
#### Notes
This is a very small bug fix release.
This release was tested by:
- Nicolas Sebrecht
#### Authors
- Jaroslav Lichtblau (1)
- Nicolas Sebrecht (1)
#### Fixes
- Revert "fix check for unsupported sep character". [Nicolas Sebrecht]
- Fixing the Arch Linux name. [Jaroslav Lichtblau]
### OfflineIMAP v7.3.1 (2019-12-15)
#### Notes

View File

@ -1,14 +1,8 @@
Upstream status (`master` branch):
[![OfflineIMAP build status on Travis-CI.org](https://travis-ci.org/OfflineIMAP/offlineimap.svg?branch=master)](https://travis-ci.org/OfflineIMAP/offlineimap)
[![OfflineIMAP code coverage on Codecov.io](https://codecov.io/gh/OfflineIMAP/offlineimap/branch/master/graph/badge.svg)](https://codecov.io/gh/OfflineIMAP/offlineimap)
[![Gitter chat](https://badges.gitter.im/OfflineIMAP/offlineimap.png)](https://gitter.im/OfflineIMAP/offlineimap)
Upstream status (`next` branch):
[![OfflineIMAP build status on Travis-CI.org](https://travis-ci.org/OfflineIMAP/offlineimap.svg?branch=next)](https://travis-ci.org/OfflineIMAP/offlineimap)
Financial contributors: [![Financial Contributors on Open Collective](https://opencollective.com/offlineimap-organization/all/badge.svg?label=financial+contributors)](https://opencollective.com/offlineimap-organization)
[offlineimap]: http://github.com/OfflineIMAP/offlineimap
[offlineimap3]: http://github.com/OfflineIMAP/offlineimap3
[website]: http://www.offlineimap.org
[wiki]: http://github.com/OfflineIMAP/offlineimap/wiki
[blog]: http://www.offlineimap.org/posts.html
@ -23,7 +17,14 @@ Links:
***"Get the emails where you need them."***
[Official offlineimap][offlineimap].
> IMPORTANT NOTE: This repository is for python2 only. The support for offlineimap3
> is happening in [Official offlineimap for python3][offlineimap3].
>
> I'll still lazily maintain this legacy offlineimap but users should definitely go with
> offlineimap3.
- [Official offlineimap for python3][offlineimap3].
- [Official offlineimap for python2][offlineimap].
## Description
@ -45,22 +46,9 @@ message without internet connection? No problem, the message is still there.
## Project status and future
> As one of the maintainer of OfflineIMAP, I'd like to put my efforts into
> [imapfw](http://github.com/OfflineIMAP/imapfw). **imapfw** is software in
> development that I intend to replace OfflineIMAP with in the long term.
>
> That's why I'm not going to continue OfflineIMAP development. I'll continue
> to maintain OfflineIMAP (fixing small bugs, reviewing patches and merging,
> and rolling out new releases), but that's all.
>
> While I keep tracking issues for OfflineIMAP, you should not expect future support.
>
> You won't be left at the side. OfflineIMAP's community is large enough so that
> you'll find people for most of your issues.
>
> Get news from the [blog][blog].
>
> Nicolas Sebrecht. ,-)
The [offlineimap][offlineimap] project was forked to
[offlineimap3][offlineimap3] to support python3. Contributions are welcome to
this project.
## Contributors
@ -106,7 +94,7 @@ Downloads releases as [tarball or zipball](https://github.com/OfflineIMAP/offlin
If you are running Linux Os, you can install offlineimap with:
- openSUSE `zypper in offlineimap`
- archLinux `pacman -S offlineimap`
- Arch Linux `pacman -S offlineimap`
- fedora `dnf install offlineimap`
## Feedbacks and contributions
@ -137,14 +125,15 @@ Bugs, issues and contributions can be requested to both the mailing list or the
## Requirements & dependencies
* Python v2.7+
* Python v2.7.x
* six (required)
* rfc6555 (required)
* imaplib2 >= 2.57 (optional)
* gssapi (optional), for Kerberos authentication
* portalocker (optional), if you need to run offlineimap in Cygwin for Windows
* Python v3.4+ ***[STALLED] (experimental: [see known issues](https://github.com/OfflineIMAP/offlineimap/issues?q=is%3Aissue+is%3Aopen+label%3APy3))***
* Python v3: See the [offlineimap3][offlineimap3] fork of
[offlineimap][offlineimap].
## Documentation

View File

@ -204,9 +204,8 @@ class OfflineimapInfo(object):
cmd = shlex.split("./offlineimap.py --version")
return run(cmd).rstrip().decode(FS_ENCODING)
def editInit(self):
return system("{} ./offlineimap/__init__.py".format(EDITOR))
def editVersion(self):
return system("{} ./offlineimap/version.py".format(EDITOR))
class User(object):

View File

@ -357,7 +357,7 @@ class Release(object):
User.request("going to make a new release after {}".format(currentVersion))
def updateVersion(self):
self.offlineimapInfo.editInit()
self.offlineimapInfo.editVersion()
def checkVersions(self, current, new):
if new == current:
@ -405,7 +405,7 @@ class Release(object):
announce.close()
def make(self):
Git.add('offlineimap/__init__.py')
Git.add('offlineimap/version.py')
Git.add('Changelog.md')
commitMsg = "v{}\n".format(newVersion)
for tester in self.testers.getListOk():

View File

@ -1,18 +1,17 @@
__all__ = ['OfflineImap']
__productname__ = 'OfflineIMAP'
# Expecting trailing "-rcN" or "" for stable releases.
__version__ = "7.3.1"
__copyright__ = "Copyright 2002-2019 John Goerzen & contributors"
__author__ = "John Goerzen"
__author_email__= "offlineimap-project@lists.alioth.debian.org"
__description__ = "Disconnected Universal IMAP Mail Synchronization/Reader Support"
__license__ = "Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)"
__bigcopyright__ = """%(__productname__)s %(__version__)s
%(__license__)s""" % locals()
__homepage__ = "http://www.offlineimap.org"
banner = __bigcopyright__
from offlineimap.version import (
__productname__,
__version__,
__copyright__,
__author__,
__author_email__,
__description__,
__license__,
__bigcopyright__,
__homepage__,
banner
)
from offlineimap.error import OfflineImapError
# put this last, so we don't run into circular dependencies using

View File

@ -1,4 +1,4 @@
# Copyright (C) 2003-2019 John Goerzen & contributors
# Copyright (C) 2003-2016 John Goerzen & contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -333,8 +333,11 @@ class SyncableAccount(Account):
folderthreads = []
hook = self.getconf('presynchook', '')
self.callhook(hook)
hook_env = {
'OIMAP_ACCOUNT_NAME': self.getname(),
}
self.callhook('presynchook', hook_env)
if self.utf_8_support and self.remoterepos.getdecodefoldernames():
raise OfflineImapError("Configuration mismatch in account " +
@ -385,24 +388,24 @@ class SyncableAccount(Account):
"[%s]"% (remotefolder.getname(), remoterepos))
continue # Ignore filtered folder.
localfolder = self.get_local_folder(remotefolder)
if not localfolder.sync_this:
self.ui.debug('', "Not syncing filtered folder '%s'"
"[%s]"% (localfolder.getname(), localfolder.repository))
continue # Ignore filtered folder.
# The remote folder names must not have the local sep char in
# their names since this would cause troubles while converting
# the name back (from local to remote).
sep = localrepos.getsep()
if (sep == os.path.sep or
sep == remoterepos.getsep() or
if (sep != os.path.sep and
sep != remoterepos.getsep() and
sep in remotefolder.getname()):
self.ui.warn('', "Ignoring folder '%s' due to unsupported "
"'%s' character serving as local separator."%
(remotefolder.getname(), localrepos.getsep()))
continue # Ignore unsupported folder name.
localfolder = self.get_local_folder(remotefolder)
if not localfolder.sync_this:
self.ui.debug('', "Not syncing filtered folder '%s'"
"[%s]"% (localfolder.getname(), localfolder.repository))
continue # Ignore filtered folder.
if not globals.options.singlethreading:
thread = InstanceLimitedThread(
limitNamespace="%s%s"% (
@ -438,20 +441,23 @@ class SyncableAccount(Account):
localrepos.holdordropconnections()
remoterepos.holdordropconnections()
hook = self.getconf('postsynchook', '')
self.callhook(hook)
self.callhook('postsynchook', hook_env)
def callhook(self, cmd):
def callhook(self, name, env={}):
# Check for CTRL-C or SIGTERM and run postsynchook.
if Account.abort_NOW_signal.is_set():
return
cmd = self.getconf(name, '')
if not cmd:
return
try:
self.ui.callhook("Calling hook: " + cmd)
if self.dryrun:
return
p = Popen(cmd, shell=True,
env = env.copy()
env.update(os.environ)
env['OIMAP_HOOK_NAME'] = name
p = Popen(cmd, shell=True, env=env,
stdin=PIPE, stdout=PIPE, stderr=PIPE,
close_fds=True)
r = p.communicate()

View File

@ -402,6 +402,7 @@ class IMAPFolder(BaseFolder):
return 0
matchinguids = matchinguids.split(' ')
matchinguids = list(set(matchinguids)) # Remove duplicates.
self.ui.debug('imap', '__savemessage_searchforheader: matchinguids now '
+ repr(matchinguids))
if len(matchinguids) != 1 or matchinguids[0] is None:

View File

@ -132,7 +132,7 @@ class IMAP4_Tunnel(UsefulIMAPMixIn, IMAP4):
"""The tunnelcmd comes in on host!"""
self.host = host
self.process = subprocess.Popen(host, shell=True, close_fds=True,
self.process = subprocess.Popen('exec %s'%host, shell=True, close_fds=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
(self.outfd, self.infd) = (self.process.stdin, self.process.stdout)
# imaplib2 polls on this fd

View File

@ -102,7 +102,7 @@ class IMAPServer(object):
self.starttls = repos.getstarttls()
if self.usessl \
and self.tlslevel is not "tls_compat" \
and self.tlslevel != "tls_compat" \
and self.sslversion is None:
raise Exception("When 'tls_level' is not 'tls_compat' "
"the 'ssl_version' must be set explicitly.")
@ -356,16 +356,13 @@ class IMAPServer(object):
return False
self.connectionlock.acquire()
self.gssapi = False
try:
imapobj.authenticate('GSSAPI', self.__gsshandler)
return True
except imapobj.error as e:
self.gssapi = False
raise
else:
self.gssapi = True
self.gss_vc = None
return True
finally:
self.gss_vc = None
self.connectionlock.release()
def __authn_cram_md5(self, imapobj):
@ -826,11 +823,12 @@ class IdleThread(object):
statusrepos = account.statusrepos
remotefolder = remoterepos.getfolder(self.folder, decode=False)
hook = account.getconf('presynchook', '')
account.callhook(hook)
hook_env = {
'OIMAP_ACCOUNT_NAME': account.getname(),
}
account.callhook('presynchook', hook_env)
offlineimap.accounts.syncfolder(account, remotefolder, quick=False)
hook = account.getconf('postsynchook', '')
account.callhook(hook)
account.callhook('postsynchook', hook_env)
ui = getglobalui()
ui.unregisterthread(currentThread()) #syncfolder registered the thread

View File

@ -545,7 +545,7 @@ class IMAPRepository(BaseRepository):
:param foldername: Full path of the folder to be created."""
if foldername is '':
if foldername == '':
return
if self.getreference():
@ -561,7 +561,8 @@ class IMAPRepository(BaseRepository):
try:
self.makefolder_single(folder_path)
except OfflineImapError as e:
if '[ALREADYEXISTS]' not in e.reason:
reasonLower = e.reason.lower() # Handle reasons '[ALREADYEXISTS]' and 'Mailbox already exists!' @chris001
if not ('already' in reasonLower and 'exists' in reasonLower):
raise
def makefolder_single(self, foldername):

View File

@ -15,13 +15,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from threading import Lock, Thread, BoundedSemaphore, currentThread
from threading import Lock, Thread, BoundedSemaphore
try:
from Queue import Queue, Empty
except ImportError: # python3
from queue import Queue, Empty
import traceback
import os.path
from offlineimap.ui import getglobalui

View File

@ -24,7 +24,7 @@ UI_LIST = {'ttyui': TTY.TTYUI,
'syslog': Noninteractive.Syslog,
'machineui': Machine.MachineUI}
#add Blinkenlights UI if it imports correctly (curses installed)
# add Blinkenlights UI if it imports correctly (curses installed)
try:
from offlineimap.ui import Curses
UI_LIST['blinkenlights'] = Curses.Blinkenlights

13
offlineimap/version.py Normal file
View File

@ -0,0 +1,13 @@
__productname__ = 'OfflineIMAP'
# Expecting trailing "-rcN" or "" for stable releases.
__version__ = "7.3.4"
__copyright__ = "Copyright 2002-2021 John Goerzen & contributors"
__author__ = "John Goerzen"
__author_email__= "offlineimap-project@lists.alioth.debian.org"
__description__ = "Disconnected Universal IMAP Mail Synchronization/Reader Support"
__license__ = "Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)"
__bigcopyright__ = """%(__productname__)s %(__version__)s
%(__license__)s""" % locals()
__homepage__ = "http://www.offlineimap.org"
banner = __bigcopyright__

View File

@ -1,5 +1,5 @@
# Requirements
six
# Minimal requirements defined in setup.py
-e .
# Extra "optional" requirements
gssapi[kerberos]
portalocker[cygwin]
rfc6555

View File

@ -5,7 +5,7 @@
# IMAP synchronization
# Module: installer
# COPYRIGHT #
# Copyright (C) 2002 - 2018 John Goerzen & contributors
# Copyright (C) 2002 - 2020 John Goerzen & contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -23,9 +23,13 @@
import os
from distutils.core import setup, Command
import offlineimap
import logging
from test.OLItest import TextTestRunner, TestLoader, OLITestLib
from os import path
here = path.abspath(path.dirname(__file__))
# load __version__, __doc__, __author_, ...
exec(open(path.join(here, 'offlineimap', 'version.py')).read())
class TestCommand(Command):
"""runs the OLI testsuite"""
@ -42,6 +46,11 @@ class TestCommand(Command):
pass
def run(self):
# Import the test classes here instead of at the begin of the module
# to avoid an implicit dependency of the 'offlineimap' module
# in the setup.py (which may run *before* offlineimap is installed)
from test.OLItest import TextTestRunner, TestLoader, OLITestLib
logging.basicConfig(format='%(message)s')
# set credentials and OfflineImap command to be executed:
OLITestLib(cred_file='./test/credentials.conf', cmd='./offlineimap.py')
@ -49,20 +58,25 @@ class TestCommand(Command):
#TODO: failfast does not seem to exist in python2.6?
TextTestRunner(verbosity=2,failfast=True).run(suite)
reqs = [
'six',
'rfc6555'
]
setup(name = "offlineimap",
version = offlineimap.__version__,
description = offlineimap.__description__,
long_description = offlineimap.__description__,
author = offlineimap.__author__,
author_email = offlineimap.__author_email__,
url = offlineimap.__homepage__,
version = __version__,
description = __description__,
long_description = __description__,
author = __author__,
author_email = __author_email__,
url = __homepage__,
packages = ['offlineimap', 'offlineimap.folder',
'offlineimap.repository', 'offlineimap.ui',
'offlineimap.utils'],
scripts = ['bin/offlineimap'],
license = offlineimap.__copyright__ + \
license = __copyright__ + \
", Licensed under the GPL version 2",
cmdclass = { 'test': TestCommand}
cmdclass = { 'test': TestCommand},
install_requires = reqs
)