Commit Graph

1868 Commits

Author SHA1 Message Date
Rodolfo García Peñas (kix)
4e31762ec6 distro_utils.py added docstring
Remove pylint warning about

C0114: Missing module docstring (missing-module-docstring)
2020-11-01 08:23:28 +01:00
Rodolfo García Peñas (kix)
9f34b14f72 const.py added docstring
Remove pylint warning about

C0114: Missing module docstring (missing-module-docstring)
2020-11-01 08:22:44 +01:00
Rodolfo García Peñas (kix)
3be65bf5dd pylint renamed variables
This patch renames some variables to avoid pylint warning about

Variable name "f" doesn't conform to snake_case naming style (invalid-name)

f is now file
th is now the_en
n is now count
2020-11-01 08:21:24 +01:00
Rodolfo García Peñas (kix)
cbfcd38bca stacktrace.py added docstring
Removed warning:

C0114: Missing module docstring (missing-module-docstring)
2020-11-01 08:16:19 +01:00
Rodolfo García Peñas (kix)
9239c804e9 Base.py remove redundant parenthesis
Just remove these parenthesis
2020-10-31 16:55:58 +01:00
Rodolfo García Peñas (kix)
8504cdc6b8 Base.py long lines style
This patch changes long lines (>80 chars) to lines <80 chars.
The patch only changes the style.
2020-10-31 16:55:20 +01:00
Rodolfo García Peñas (kix)
23f67019cc Base.py long lines style
This patch changes long lines (>80 chars) to lines <80 chars.
The patch only changes the style.
2020-10-31 16:43:52 +01:00
Rodolfo García Peñas (kix)
332a6d7240 IMAP.py long lines style
This patch changes long lines (>80 chars) to lines <80 chars.
The patch only changes the style.
2020-10-31 16:14:53 +01:00
Rodolfo García Peñas (kix)
1ce229ca9d IMAP.py comparison with None should use is
Comparison with None should be "is" not "=="
2020-10-31 16:12:02 +01:00
Rodolfo García Peñas (kix)
2f2f4ef918 IMAP.py long lines style
This patch changes long lines (>80 chars) to lines <80 chars.
The patch only changes the style.
2020-10-31 16:09:34 +01:00
Rodolfo García Peñas (kix)
5033340c2f IMAP.py should use encoding to read the file
This patch includes the word "encoding" to select the right argument in remotepassfile.
2020-10-31 15:53:45 +01:00
Rodolfo García Peñas (kix)
cbbeebbf44 imapserver.py removed extra parenthesis
We can remove this parenthesis.
2020-10-31 15:39:28 +01:00
Rodolfo García Peñas (kix)
0e90bcbf38 IMAP.py too many arguments for string format
We need only two arguments, not three. We can remove the self argument.
2020-10-31 15:37:50 +01:00
Rodolfo García Peñas (kix)
352133dcc0 call to setDaemon uses Bool argument
The argument 1 should be True in these files.
2020-10-31 15:35:54 +01:00
Rodolfo García Peñas (kix)
78aeed20a9 imapserver call to OfflineImapError with right arguments
Call to OfflineImapError has the arguments:

- message
- severity
- error code

The None argument ir wrong here, we can remove it and then we have three arguments not four.
2020-10-31 15:29:24 +01:00
Rodolfo García Peñas (kix)
26efc62ba7 imapserver import style
This patch removes the unused import socket line. (warning)

Split the line with multiple imports in different lines. (warning)
2020-10-31 15:24:40 +01:00
Rodolfo García Peñas (kix)
a60ca038ce Updated cram-md5 authentication
This patch updates the cram-md5 auth. We include two steps:

- Convert the password variable from string to bytes. This change is
  because in Python2 strings and bytes are the same, but not in Python3
- Updates the call to hmac.new, now the digestmod argument is mandatory.
  I used hashlib.md5, because we need md5 hash.

Closes #19

    Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-10-31 00:09:38 +01:00
Rodolfo García Peñas (kix)
a4863b2f04 Use system sslcacertfile by default
This patch includes a new functionality to get the sslcacertfile.

With this patch is possible to remove the sslcacertfile variable form the
.offlineimaprc and use the system's default. This could be easy for new users.

With this patch, the user can use ssl without the sslcacertfile option
in .offlineimaprc, use sslcacertfile = <empty> (no include anything
after the equal sign, os specify the sslcacertfile as previosly.

Currently, these are the options:

    User specifies sslacertfile -> OK
    User specifies sslacertfile=OS-DEFAULT
        If the system's default is provided -> OK
        If the system's default is not provided -> Fail
    User do not specifies sslacertfile -> Fail
    User specifies empty sslacertfile -> Fail

With the new option (this patch).

    User specifies sslacertfile -> OK
    User specifies sslacertfile=OS-DEFAULT or
    User do not specifies sslacertfile or
    User specifies empty sslacertfile
        If the system's default is provided -> OK
        If the system's default is not provided -> Fail

Closes #14
2020-10-26 12:10:49 +01:00
Rodolfo García Peñas (kix)
442c88d838 imaplib expect bytes in the append
imaplib2 is doing this code for strings:

        if isinstance(message, str):
            message = bytes(message, 'ASCII')

But our message is already encoded using 'utf-8'.
Then, we can set the message as bytes, encoded using 'utf-8'
in offlineimap and imaplib2 won't change our message.

This patch solves this problem:

WARNING:OfflineImap:
Traceback:
  File "/home/kix/src/offlineimap3/offlineimap/folder/Base.py", line 1127, in syncmessagesto
    action(dstfolder, statusfolder)
  File "/home/kix/src/offlineimap3/offlineimap/folder/Base.py", line 955, in __syncmessagesto_copy
    self.copymessageto(uid, dstfolder, statusfolder, register=0)
  File "/home/kix/src/offlineimap3/offlineimap/folder/Base.py", line 855, in copymessageto
    new_uid = dstfolder.savemessage(uid, message, flags, rtime)
  File "/home/kix/src/offlineimap3/offlineimap/folder/IMAP.py", line 668, in savemessage
    (typ, dat) = imapobj.append(self.getfullIMAPname(),
  File "/usr/lib/python3/dist-packages/imaplib2.py", line 660, in append
    message = bytes(message, 'ASCII')
2020-10-25 20:36:07 +01:00
Rodolfo García Peñas (kix)
47f7b1ba3c get_os_sslcertfile_searchpath do not check iterable
Now, location is always an iterable, so we don't need check it.
2020-10-25 17:32:38 +01:00
Rodolfo García Peñas (kix)
a1f8576937 distro_utils do not compare types
This patch now use isinstance to compare types.
2020-10-25 17:27:40 +01:00
Rodolfo García Peñas (kix)
fe25a5c752 Distro default certificates must be iterables
This patch changes the __DEF_OS_LOCATIONS to an iterable value.

The reason is because a list is an iterable, but an string is an
iterable too, and this is a mistake.

The function get_os_sslcertfile() has a loop to iterate the return of
get_os_sslcertfile_searchpath(), that returns the value in the
__DEF_OS_LOCATIONS dictionary. When the value is an iterable, the "f"
variable is set to the iterable value and works fine.
If the value of "f" is an string, the for-loop iterates over every
character, so the test for os.path.exists is always false (is comparing
the path with a character, not with the full path), so this function
fails and return None.

To check this change, edit your .offlineimaprc file and change the
sslcacertfile to OS-DEFAULT:

sslcacertfile = OS-DEFAULT

And run offlineimap. If you are not using 'darwin0 (the only iterable)
it will fails. Now, apply this patch, and run offlineimap again. Problem
is solved.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-10-25 17:26:20 +01:00
Rodolfo García Peñas (kix)
bde48fe2c7 Renamed l variable to location_name
This variable is renamed to avoid a warning about ambiguous name.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-10-25 16:42:09 +01:00
Rodolfo García Peñas (kix)
5777553a96 Renamed l variable to location_name
This variable is renamed to avoid a warning about ambiguous name.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-10-25 16:40:50 +01:00
Rodolfo García Peñas (kix)
714cbe2327 Renamed OS to os_name in get_os_sslcertificate_searchpath
This patch changes this variable name only.
2020-10-25 16:40:07 +01:00
Rodolfo García Peñas (kix)
07c1a5c9db Deprecated linux_distribution
The call from platform.linux_distribution was depdrecated in Python 3.7.

This patch solves this problem, using the recomended package distro.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2020-10-25 16:38:16 +01:00
Rodolfo García Peñas (kix)
f66bfb0026 Renamed utils/distro.py
The file utils/distro.py is renamed to utils/distro_utils.py
because we need import the distro file to update some calls.

The file is used in IMAP.py, I need change the import.
2020-10-25 16:33:52 +01:00
Rodolfo García Peñas (kix)
faff27f0c9 Renamed variable DISTRO to distro_name
Variable DISTRO should be lowercase. I renamed it to distro_name.
2020-10-25 15:47:50 +01:00
Rodolfo García Peñas (kix)
997f5b27c5 Renamed variable OS to os_name
Variable OS should be in lowercase.
2020-10-25 15:47:22 +01:00
Thomas De Schampheleire
33e0efa163 IMAP: replace non-UTF-8 characters rather than aborting
Emails received may not be UTF-8. Following error was observed on a specific
mail:

Traceback (most recent call last):
  File "/home/tdescham/repo/offlineimap3/offlineimap/threadutil.py", line 146, in run
    Thread.run(self)
  File "/usr/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/tdescham/repo/offlineimap3/offlineimap/folder/Base.py", line 850, in copymessageto
    message = self.getmessage(uid)
  File "/home/tdescham/repo/offlineimap3/offlineimap/folder/IMAP.py", line 327, in getmessage
    data = self._fetch_from_imap(str(uid), self.retrycount)
  File "/home/tdescham/repo/offlineimap3/offlineimap/folder/IMAP.py", line 844, in _fetch_from_imap
    ndata1 = data[0][1].decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 10177: invalid start byte

This completely aborted offlineimap3, blocking further mail reception.

Instead, use the 'replace' error strategy in Python:

    Replace with a suitable replacement character; Python will use the
    official U+FFFD REPLACEMENT CHARACTER for the built-in Unicode codecs on
    decoding and ‘?’ on encoding.
    https://docs.python.org/2/library/codecs.html#codec-base-classes
2020-10-21 16:29:13 +02:00
Thomas De Schampheleire
820e5c855f IMAP: Python 3 bytes fix on first download of account
ERROR: ERROR in syncfolder for gmail folder INBOX: Traceback (most recent call last):
  File ".../offlineimap3/offlineimap/accounts.py", line 634, in syncfolder
    cachemessagelists_upto_date(maxage)
  File ".../offlineimap3/offlineimap/accounts.py", line 526, in cachemessagelists_upto_date
    min_date=time.gmtime(time.mktime(date) + 24 * 60 * 60))
  File ".../offlineimap3/offlineimap/folder/IMAP.py", line 277, in cachemessagelist
    imapobj, min_date=min_date, min_uid=min_uid)
  File ".../offlineimap3/offlineimap/folder/IMAP.py", line 259, in _msgs_to_fetch
    search_result = search(search_cond)
  File ".../offlineimap3/offlineimap/folder/IMAP.py", line 222, in search
    if ' ' in res_data[0] or res_data[0] == '':
TypeError: a bytes-like object is required, not 'str'
2020-10-21 14:28:23 +02:00
Rodolfo García Peñas (kix)
49c85d732d Using isinstance instead type
This patch uses isinstance, like Thomas pointed in their last commit.
2020-10-12 12:52:04 +02:00
Rodolfo García Peñas (kix)
d8149c1ec1
Merge pull request #7 from patrickdepinguin/py3fix
More python 3 related fixes
2020-10-12 12:44:19 +02:00
Rodolfo García Peñas (kix)
ba6857bc87 Remove email.Parse
The Parse funcion was deprecated in python 2.4. We can use this new
code.
2020-10-12 12:40:54 +02:00
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
Thomas De Schampheleire
c00af91990 accounts: decode output of hooks
When a hook is configured, the output is a bytes object.
This is then printed on the console/logfile as:

    2020-10-12 08:36:17 INFO: Hook stdout: b'Processed 3 total files in almost no time.\nAdded 3 new messages to the database.\n'
    Hook stderr:b''

Decode the output so that it is printed nicely, as:

    2020-10-12 08:36:17 INFO: Hook stdout: Processed 3 total files in almost no time.
    Added 3 new messages to the database.

    Hook stderr:

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
2020-10-12 09:01:59 +02:00
Thomas De Schampheleire
423785725b IMAP.py: server responses are in bytes, not string
Following error is seen when parsing server responses for sent mail:

2020-10-12 08:19:11 WARNING: Can't parse FETCH response, we awaited string: b' UID 26855)'
2020-10-12 08:19:11 WARNING: savemessage: Searching mails for new Message-ID failed. Could not determine new UID on Sent.

The comparison with 'type("")' means comparing with 'string' type in Python
3, but the left-hand side is a bytes object.

In case a tuple was received (first case in the code), the input is already
decoded from bytes to strings, but in case a single input was received it
was not.

Note that the comparison with 'type("")' is a bit odd, a more logical way
seems to be:
    if isinstance(item, bytes)

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
2020-10-12 09:01:51 +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
Rodolfo García Peñas (kix)
b860e93072 imapserver.py removed unreacheable code
This code is not reacheable.
2020-08-30 18:32:42 +02:00
Rodolfo García Peñas (kix)
26668d29b0 imapserver.py removed extra characters
these characters could be removed.
2020-08-30 18:31:30 +02:00
Rodolfo García Peñas (kix)
e463da6c19 imaplibutil.py do not use builtin names as variables
I changed these names:

hash to my_hash
min to minu
2020-08-30 18:27:40 +02:00
Rodolfo García Peñas (kix)
d02b0a5c3e imaplibutil.py removed extra characters
I removed these characters.
2020-08-30 18:23:29 +02:00
Rodolfo García Peñas (kix)
222cd235d6 emailutil.py updated docstrings
Argument added.
2020-08-30 18:21:00 +02:00
Rodolfo García Peñas (kix)
2c0858f19b CustomConfig.py Removed extra characters
I removed these extra characters.
2020-08-30 18:20:07 +02:00
Rodolfo García Peñas (kix)
df28136bb3 accounts.py Removed extra spaces after equal
I changed the intentation to join the equal with the quote.
2020-08-30 18:19:05 +02:00
Rodolfo García Peñas (kix)
142041130d utils/const.py Removed extra characters
These characters could be removed.
2020-08-30 18:14:15 +02:00
Rodolfo García Peñas (kix)
fefe69c0e9 ui/UIBase.py do not use builtin object as variable
Renamed from object to mobject.
2020-08-30 18:12:17 +02:00
Rodolfo García Peñas (kix)
d5ab101cf4 ui/UIBase.py do not use builtin type as variable
Renamed from type to rtype.
2020-08-30 18:10:51 +02:00
Rodolfo García Peñas (kix)
833816cf62 ui/UIBase.py split the if
This patch splits the if to avoid multiple commands in the same line.
2020-08-30 18:09:32 +02:00
Rodolfo García Peñas (kix)
b1a719ad9e ui/UIBase.py changed not var in
This patch changes:

if not var1 in var2

with

if var1 not in var2
2020-08-30 18:07:59 +02:00
Rodolfo García Peñas (kix)
5ad87efb84 ui/UIBase.py removed extra characters
These chars could be removed.
2020-08-30 18:06:14 +02:00
Rodolfo García Peñas (kix)
d4f9d101c4 ui/Machine.py Removed extra parenthesys
This parsys should be removed.
2020-08-30 18:00:49 +02:00
Rodolfo García Peñas (kix)
f78c8e1ef4 ui/Machine.py Renamed list argument
The list is a standard word for list. This variable should have other
name.
2020-08-30 17:58:53 +02:00
Rodolfo García Peñas (kix)
edb6563a11 ui/Machine.py changed argument s to self
The standard name is self, not s.

I reformat the file after this change.
2020-08-30 17:57:46 +02:00
Rodolfo García Peñas (kix)
7634ce10d1 ui/debuglock.py Removed extra backslashes
These backslashes could be removed.
2020-08-30 17:47:18 +02:00
Rodolfo García Peñas (kix)
cfce5c8500 BUG: Do not sort accounts
Is not possible to sort acounts on this way. We need make the comparison
using their names, not their keys.
2020-08-30 17:42:52 +02:00
Rodolfo García Peñas (kix)
6bf45233bb ui/Curses.py avoid multiple statements in one line 2020-08-30 15:59:21 +02:00
Rodolfo García Peñas (kix)
5ebbba2995 ui/Curses.py updated docstring
This patch includes a param in docstring.
2020-08-30 15:56:49 +02:00
Rodolfo García Peñas (kix)
10c37cf7a4 ui/Curses.py unused variable
This variable is not used.
2020-08-30 15:54:20 +02:00
Rodolfo García Peñas (kix)
a69ef4325a ui/Curses.py removed extra characters
These characters could be removed.
2020-08-30 15:50:01 +02:00
Rodolfo García Peñas (kix)
ccbe42fb64 repository/Maildir.py changed not var in
This patch changes:

if not var1 in var2

with

if var1 not in var2
2020-08-30 14:25:55 +02:00
Rodolfo García Peñas (kix)
9779d5444a repository/IMAP.py Removed initialitation
We don't need initialite this variable here.
2020-08-30 14:21:04 +02:00
Rodolfo García Peñas (kix)
78b010d149 repository/IMAP.py Removed extra characters
These characters can be removed.
2020-08-30 14:19:34 +02:00
Rodolfo García Peñas (kix)
75f979d45b repository/Gmail.py Unused argument
I removed this argument. The function is not used.
2020-08-30 14:17:10 +02:00
Rodolfo García Peñas (kix)
3aba335109 repository/Base.py changed not var in
This patch changes:

if not var1 in var2

with

if var1 not in var2
2020-08-30 14:15:49 +02:00
Rodolfo García Peñas (kix)
ad0920de72 repository/Base.py Changed indentation
I joined the lines to avoid indentantion warning
2020-08-30 14:14:45 +02:00
Rodolfo García Peñas (kix)
2248a85f64 repository/__init__.py Removed unused variable
This variable is not used.
2020-08-30 14:13:27 +02:00
Rodolfo García Peñas (kix)
e496525b8b repository/__init__.py Removed extra chars
These parenthesis are not needed.
2020-08-30 14:12:35 +02:00
Rodolfo García Peñas (kix)
28470ae655 folder/UIDMaps.py Removed extra chars
These chars can be removed.
2020-08-30 14:10:53 +02:00
Rodolfo García Peñas (kix)
db1ee5b3e9 folder/UIDMaps.py changed not var in
This patch changes:

if not var1 in var2

with

if var1 not in var2
2020-08-30 14:04:43 +02:00
Rodolfo García Peñas (kix)
4442a7ce67 folder/UIDMaps.py import fcntl
First, this file calls fcntl, but it has a typo.

Then, I import the fcntl library, as done in offlineimap/accounts.py
using portalocker first.
2020-08-30 14:01:51 +02:00
Rodolfo García Peñas (kix)
e4cb1a93be Removed unused variables
These variables are not used
2020-08-30 13:55:30 +02:00
Rodolfo García Peñas (kix)
8cbdc65ebf folder/UIDMaps.py split the if
This patch splits the if to avoid multiple commands in the same line.
2020-08-30 13:53:57 +02:00
Rodolfo García Peñas (kix)
c68e70519d folder/Maildir.py split the if
This patch splits the if to avoid multiple commands in the same line.
2020-08-30 13:51:34 +02:00
Rodolfo García Peñas (kix)
1bcd7d3d4d folder/Maildir.py Removed unused variables
These variables are not used.
2020-08-30 13:51:34 +02:00
Rodolfo García Peñas (kix)
91df77f69f folder/Maildir.py Updated docstrings 2020-08-30 13:51:29 +02:00
Rodolfo García Peñas (kix)
3d2692103f folder/Maildir.py changed not var in
This patch changes:

if not var1 in var2

with

if var1 not in var2
2020-08-30 13:42:09 +02:00
Rodolfo García Peñas (kix)
28910df6c2 folder/Maildir.py removed extra chars
I removed some extra ()
2020-08-30 13:40:14 +02:00
Rodolfo García Peñas (kix)
a1f907696f folder/LocalStatusSQLite.py split the if
This patch splits the if to avoid multiple commands in the same line.
2020-08-30 13:37:28 +02:00
Rodolfo García Peñas (kix)
8742ff4311 folder/LocalStatusSQLite.py changed not var in
This patch changes:

if not var1 in var2

with

if var1 not in var2
2020-08-30 13:36:40 +02:00
Rodolfo García Peñas (kix)
6059cf13ba folder/LocalStatusSQLite.py Removed extra chars
This patch removes the (). Are not needed.
2020-08-30 13:35:14 +02:00
Rodolfo García Peñas (kix)
5005de021d folder/LocalStatus.py split the if
This patch splits the if to avoid multiple commands in the same line.
2020-08-30 13:34:05 +02:00
Rodolfo García Peñas (kix)
b257cdca04 folder/LocalStatus.py Removed unused variables
These variables are not used.
2020-08-30 13:32:36 +02:00
Rodolfo García Peñas (kix)
dc8872377c folder/IMAP.py Removed unused variables
These variables are not used.
2020-08-30 13:30:39 +02:00
Rodolfo García Peñas (kix)
c3fe45ff2b folder/IMAP.py added docstrings arguments 2020-08-30 13:28:36 +02:00
Rodolfo García Peñas (kix)
88230bda47 folder/IMAP.py removed extra chars
This patch removes some backslash and (, )
2020-08-30 13:26:20 +02:00
Rodolfo García Peñas (kix)
9d93a6de8f folder/GmailMaildir.py changed not var in
This patch changes:

if not var1 in var2

with

if var1 not in var2
2020-08-30 13:23:07 +02:00
Rodolfo García Peñas (kix)
4facfacc48 folder/Gmail.py changed not var in
This patch changes not var in with var not in
2020-08-30 13:20:17 +02:00
Rodolfo García Peñas (kix)
e3533e7fa9 folder/Gmail.py Removed extra backslash
This backslash could be removed.
2020-08-30 13:19:27 +02:00
Rodolfo García Peñas (kix)
6be58c297d folder/Gmail.py added docstrings
This patch adds the docstrings
2020-08-30 13:18:18 +02:00
Rodolfo García Peñas (kix)
2ff748ac0e folder/Base.py Added docstrings params
This patch only adds some docstrings params.
2020-08-30 13:05:32 +02:00
Rodolfo García Peñas (kix)
1fc10875a6 folder/Base.py changed not var in
This patch changes:

if not var1 in var2

with

if var1 not in var2
2020-08-30 12:42:28 +02:00
Rodolfo García Peñas (kix)
56299086e2 folder/Base.py Removed extra parenthesis
This patch removes these extra characteres.
2020-08-30 12:40:28 +02:00
Rodolfo García Peñas (kix)
1a529b6b0e offlineimap/ files singleton-comparison
This patch change these errors in the offlineimap folder

C0121: Comparison to None should be 'expr is None' (singleton-comparison)
C0121: Comparison to None should be 'expr is not None' (singleton-comparison)
2020-08-30 11:27:03 +02:00
Rodolfo García Peñas (kix)
da2baaaeb7 offlineimap/utils files singleton-comparison
This patch change these errors in the utils folder

C0121: Comparison to None should be 'expr is None' (singleton-comparison)
C0121: Comparison to None should be 'expr is not None' (singleton-comparison)
2020-08-30 11:18:18 +02:00
Rodolfo García Peñas (kix)
7b082f0fe9 offlineimap/folder files singleton-comparison
This patch change these errors in the 'folder' folder

C0121: Comparison to None should be 'expr is None' (singleton-comparison)
C0121: Comparison to None should be 'expr is not None' (singleton-comparison)
2020-08-30 11:15:00 +02:00
Rodolfo García Peñas (kix)
229aa59dba offlineimap/ui files singleton-comparison
This patch change these errors in the ui folder

C0121: Comparison to None should be 'expr is None' (singleton-comparison)
C0121: Comparison to None should be 'expr is not None' (singleton-comparison)
2020-08-30 11:07:59 +02:00
Rodolfo García Peñas (kix)
30afe4645e offlineimap/repository files singleton-comparison
This patch change these errors in the repository folder

C0121: Comparison to None should be 'expr is None' (singleton-comparison)
C0121: Comparison to None should be 'expr is not None' (singleton-comparison)
2020-08-30 11:03:57 +02:00
Rodolfo García Peñas (kix)
a186f65444 Maildir removed extra slash
This slash should be removed. I also join the lines.
2020-08-30 10:57:42 +02:00
Rodolfo García Peñas (kix)
c64275d27d bundled_imaplib2.py Do not make object inheritance
This patch removes these lintian warnings:

Warning R0205: Class 'X' inherits from object,
can be safely removed from bases in python3 (useless-object-inheritance)
2020-08-30 10:48:53 +02:00
Rodolfo García Peñas (kix)
3fafc3a46d Reformat offlineimap/bundled_imaplib2.py
Add/remove whitespaces, lines,...
2020-08-30 10:47:34 +02:00
Rodolfo García Peñas (kix)
e77440552c Do not make object inheritance
This patch removes these lintian warnings:

Warning R0205: Class 'X' inherits from object,
can be safely removed from bases in python3 (useless-object-inheritance)
2020-08-29 21:44:18 +02:00