Commit Graph

1732 Commits

Author SHA1 Message Date
Rodolfo García Peñas (kix)
62df6e70c3 Rigth comparison with err EEXIST
This is the right code. The OSError doesn't have the EEXIST variable.
2020-10-12 12:35:56 +02:00
Rodolfo García Peñas (kix)
3d5f926552 Changed the doxygen in change_message_uid
This patch changes the doxygen and adds the ruid argument.
2020-10-11 23:57:17 +02:00
Rodolfo García Peñas (kix)
01c621d86c Allow folder names with atom specials
This patch allows using folders with atom-specials like
"(", ")", spaces,...

We need quotes the folder name if it includes this special
characters.

Closes #4
2020-10-11 23:01:08 +02:00
Rodolfo García Peñas (kix)
011cfbc670 Do not use built-in list variable
This patch changes the ilst built-in variable to l_list.
2020-10-10 18:59:04 +02:00
Rodolfo García Peñas (kix)
0c04611ca4 Changed doxygen parameter
The parameter regtype does not exists, it is reqtype.
2020-10-10 17:48:30 +02:00
Rodolfo García Peñas (kix)
bb05904cf1 Renamed variable already used
The variable l was used in tn the code, so we should change it in
this code block.
2020-10-10 17:24:18 +02:00
Rodolfo García Peñas (kix)
659b38bcf7 Base.py Comment unused code in savemessagelabels
This code is not used, we can comment it.
2020-10-10 17:23:05 +02:00
Rodolfo García Peñas (kix)
7ff65be690 Removed mutable arguments
This patch remves the set() mutable argument as default value,
sets the default value to None and check if the argument is none
in the code to call set().
2020-10-10 15:00:34 +02:00
Rodolfo García Peñas (kix)
fb909671c8 Removed doxygen param
This param does not exists in the monitor function.
2020-10-10 14:50:47 +02:00
Thomas De Schampheleire
78807b55b4 imapserver.py: fix __xoauth2handler in Python 3
Error when using the XOAUTH2 token refresh logic:

  ("POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str. (configuration is: {....}", <traceback object at 0x7fc6e69f2b40>)
     ['  File ".../offlineimap3/offlineimap/accounts.py", line 298, in syncrunner
        self.__sync()
    ', '  File ".../offlineimap3/offlineimap/accounts.py", line 374, in __sync
        remoterepos.getfolders()
    ', '  File ".../offlineimap3/offlineimap/repository/IMAP.py", line 446, in getfolders
        imapobj = self.imapserver.acquireconnection()
    ', '  File ".../offlineimap3/offlineimap/imapserver.py", line 579, in acquireconnection
        self.__authn_helper(imapobj)
    ', '  File ".../offlineimap3/offlineimap/imapserver.py", line 443, in __authn_helper
        if func(imapobj):
    ', '  File ".../offlineimap3/offlineimap/imapserver.py", line 377, in __authn_xoauth2
        imapobj.authenticate(\'XOAUTH2\', self.__xoauth2handler)
    ', '  File ".../offlineimap3/venv/lib/python3.7/site-packages/imaplib2.py", line 681, in authenticate
        typ, dat = self._simple_command(\'AUTHENTICATE\', mechanism.upper())
    ', '  File ".../offlineimap3/venv/lib/python3.7/site-packages/imaplib2.py", line 1674, in _simple_command
        return self._command_complete(self._command(name, *args), kw)
    ', '  File ".../offlineimap3/venv/lib/python3.7/site-packages/imaplib2.py", line 1394, in _command
        literal = literator(data, rqb)
    ', '  File ".../offlineimap3/venv/lib/python3.7/site-packages/imaplib2.py", line 2237, in process
        ret = self.mech(self.decode(data))
    ', '  File ".../offlineimap3/offlineimap/imapserver.py", line 253, in __xoauth2handler
        raise type(e)(msg, exc_info()[2])
    ']

Fix by encoding the data passed to urllib.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
2020-09-29 10:04:07 +02:00
Rodolfo García Peñas (kix)
7fff7fc458 repository/__init__.py remove try import python2
This patch removes the dup code between try and catch

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:36:10 +02:00
Rodolfo García Peñas (kix)
9123cb83fc Remove md5 import
The library md5 is only for python2, hashlib is used in python3

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:36:09 +02:00
Rodolfo García Peñas (kix)
bab7dd00c9 offlineimap/accounts added Exception with lock file
This patch includes an Exception to catch when two instances of
offlineimap are running.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:36:08 +02:00
Rodolfo García Peñas (kix)
35b588f57e six: changed offlineimap/repository/__init__.py
This patch removes the library six, compatible with python2.

I need change these re-raise calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:36:05 +02:00
Rodolfo García Peñas (kix)
6321a66287 six: changed offlineimap/repository/IMAP.py
This patch removes the library six, compatible with python2.

I need change this re-raise call.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:36:04 +02:00
Rodolfo García Peñas (kix)
4e1558adc3 six: changed offlineimap/imapserver.py
This patch removes the library six, compatible with python2.

I need change these re-raise calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:36:03 +02:00
Rodolfo García Peñas (kix)
edf22e0e96 six: changed offlineimap/imaplibutil.py
This patch removes the library six, compatible with python2.

I need change this re-raise call.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:36:02 +02:00
Rodolfo García Peñas (kix)
cefac73af4 six: changed offlineimap/folder/IMAP.py
This patch removes the library six, compatible with python2.

I need change these re-raise calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:36:01 +02:00
Rodolfo García Peñas (kix)
ba11b2d684 six: changed offlineimap/folder/Maildir.py
This patch removes the library six, compatible with python2.

I need change these re-raise calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:36:00 +02:00
Rodolfo García Peñas (kix)
4b32d62fe9 six: changed offlineimap/folder/GmailMaildir.py
This patch removes the library six, compatible with python2.

I need change this re-raise call.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:59 +02:00
Rodolfo García Peñas (kix)
bafcef77fd six: changed offlineimap/folder/Gmail.py
This patch removes the library six, compatible with python2.

I need change this re-raise call.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:58 +02:00
Rodolfo García Peñas (kix)
75c718c75b six: changed offlineimap/folder/UIDMaps.py
This patch removes the library six, compatible with python2.

I need change these re-raise calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:57 +02:00
Rodolfo García Peñas (kix)
dd3e7616cf six: changed offlineimap/folder/LocalStatusSQLite.py
This patch removes the library six, compatible with python2.

I need change these re-raise calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:56 +02:00
Rodolfo García Peñas (kix)
a922ab3103 six: changed offlineimap/folder/LocalStatus.py
This patch removes the library six, compatible with python2.

I need change these re-raise calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:55 +02:00
Rodolfo García Peñas (kix)
493aefc09d six: changed offlineimap/CustomConfig.py
This patch removes the library six, compatible with python2.

I need change this re-raise call.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:54 +02:00
Rodolfo García Peñas (kix)
b8137a8028 six: changed offlineimap/accounts.py
This patch removes the library six, compatible with python2.

I need change these re-raise calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:53 +02:00
Rodolfo García Peñas (kix)
df4b9174d7 IMAP.py __savemessage_fetchheaders decode bytes
This patch changes the function __savemessage_fetchheaders to decode the
bytes retunred by imaplib2.

We need a list of headers, with string values, but imapli2 is providing
a list with bytes. This change convert the values to str.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:52 +02:00
Rodolfo García Peñas (kix)
b24687fcd6 Gmail.py Get the server response right
Now, the server response is in a list of strings. We need the second
string, so we need read the [1].

Previously, was a list of tuples, so, we used [0][1].

This patch is like the patch IMAP.py Get the server response right, but
now for Gmail.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:51 +02:00
Rodolfo García Peñas (kix)
6f622c7b27 repository/IMAP.py getselectors updated
In the patch "IMAP list folders" we updated the function getselectors
to return '""'. We use this variable in the folders, but also here.

Because the variable is never '', we need update it with this change, to
test that the variable has value, but is not empty.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:49 +02:00
Rodolfo García Peñas (kix)
8e63f58b22 folder/IMAP.py matching uids is a list
matchinguids variable is a list of UIDs, separated by spaces. You can
check it some lines later, using the split command.

We need decode the bytes value returned by imaplib2 and convert it to
sting.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-09-03 21:35:48 +02:00
Rodolfo García Peñas (kix)
41c2ced1d5 IMAP.py _msgs_to_fetch decode bytes
imaplib2 returns the type as string, like "OK" but
returns imapdata as list of bytes, like [b'0'] so we need decode it
to use the existing code
2020-09-01 19:07:52 +02:00
Rodolfo García Peñas (kix)
caaa953616 IMAP.py list folders
This patch changes the refernce to "", because now the empty string
is not saved as '""', is just '', so the fecth command fails.

Then, I changed the fech call to "" "*", using refernce "" and pattern
"*".
2020-09-01 18:21:27 +02:00
Rodolfo García Peñas (kix)
7947aea7a9 imapserver call LIST using empty quotes
The LIST command needs empty quotes, like

LIST ""

This is the right argument.
2020-09-01 18:21:27 +02:00
Rodolfo García Peñas (kix)
1ff54e7a7c IMAP.py Get the server response right
Now, the server response is in a list of strings. We need the second
string, so we need read the [1].

Previously, was a list of tuples, so, we used [0][1].
2020-09-01 18:21:27 +02:00
Rodolfo García Peñas (kix)
ea8c0c6f3e __generate_randomheader uses now string
This patch converts the string to bytes to use crc32.

We can remore the fffffff because in python3 is always positive value.
In other patch.
2020-09-01 17:40:12 +02:00
Rodolfo García Peñas (kix)
7980f7ff1a IMAP.py calls Internaldate2epoch with bytes argument
The function Internaldate2epoch needs a bytes argument,
not an string, we need encode it:

imaplibutil.Internaldate2epoch(messagestr.encode('utf-8'))
2020-09-01 17:40:12 +02:00
Rodolfo García Peñas (kix)
b6cec81090 imalplibutil calls strptime with string
datetime.datetime.strptime wants a string object,
but we have a bytes object. We need decode it.
2020-08-31 18:12:29 +02:00
Rodolfo García Peñas (kix)
d011702b5b removed virtual_imaplib2
Now we use the system imaplib2. I am using Debian.
2020-08-31 16:24:26 +02:00
Rodolfo García Peñas (kix)
4d293c8eea threadutil.py removed extra parenthesys
These characters could be removed.
2020-08-30 18:54:52 +02:00
Rodolfo García Peñas (kix)
16f46c81cd threadutil.py changed not var in
This patch changes:

if not var1 in var2

with

if var1 not in var2
2020-08-30 18:54:01 +02:00
Rodolfo García Peñas (kix)
239b921056 mbnames.py removed extra parenthesys
These characters could be removed.
2020-08-30 18:53:02 +02:00
Rodolfo García Peñas (kix)
36ab6066e8 localeval.py removed extra parenthesys
These characters could be removed.
2020-08-30 18:52:56 +02:00
Rodolfo García Peñas (kix)
64cb6c45ec init.py removed unused variable
This variable is not used later.
2020-08-30 18:50:58 +02:00
Rodolfo García Peñas (kix)
fff1687e43 init.py warn is deprecated, using warning
loggin.warn is changed to loggin.warning
2020-08-30 18:49:50 +02:00
Rodolfo García Peñas (kix)
8b6562b471 init.py changed not var in
This patch changes:

if not var1 in var2

with

if var1 not in var2
2020-08-30 18:47:24 +02:00
Rodolfo García Peñas (kix)
3de236b4a1 init.py removed extra characters
these characters could be removed
2020-08-30 18:46:08 +02:00
Rodolfo García Peñas (kix)
e3df3d4691 imaputil.py split the if
This patch splits the if to avoid multiple commands in the same line.
2020-08-30 18:43:22 +02:00
Rodolfo García Peñas (kix)
abdaabb866 imaputil.py removed extra characters
these characters could be removed
2020-08-30 18:43:18 +02:00
Rodolfo García Peñas (kix)
54fbfc67b4 imapserver.py updated docstring
Added argument.
2020-08-30 18:37:09 +02:00
Rodolfo García Peñas (kix)
b118b80897 imapserver.py Removed unused variables
These variables are not used.
2020-08-30 18:35:01 +02:00