Commit Graph

475 Commits

Author SHA1 Message Date
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)
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)
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
Rodolfo García Peñas (kix)
7d62441dc2 Changed import order
These changes close the lintian warning C0411.
2020-08-29 21:10:16 +02:00
Rodolfo García Peñas (kix)
b94983ee8a Removed extra line in offlineimap/folder/__init__.py
Removed extra line at EOF.
2020-08-29 20:41:27 +02:00
Rodolfo García Peñas (kix)
3a1b25c204 Reformat offlineimap/folder/UIDMaps.py
Add some spaces, remove lines,... now format is better (lintian).
2020-08-29 19:48:04 +02:00
Rodolfo García Peñas (kix)
eafd9eb51d Reformat offlineimap/folder/Maildir.py
Add some spaces, remove lines,... now format is better (lintian).
2020-08-29 19:46:43 +02:00
Rodolfo García Peñas (kix)
265de25460 Reformat offlineimap/folder/LocalStatusSQLite.py
Add some spaces, remove lines,... now format is better (lintian).
2020-08-29 19:45:15 +02:00
Rodolfo García Peñas (kix)
cb95bc87b0 Reformat offlineimap/folder/LocalStatus.py
Add some spaces, remove lines,... now format is better (lintian).
2020-08-29 19:43:52 +02:00
Rodolfo García Peñas (kix)
da1788db53 Reformat offlineimap/folder/IMAP.py
Add some spaces, remove lines,... now format is better (lintian).
2020-08-29 19:43:09 +02:00
Rodolfo García Peñas (kix)
2f97dda6d9 Reformat offlineimap/folder/GmailMaildir.py
Add some spaces, remove lines,... now format is better (lintian).
2020-08-29 19:42:20 +02:00
Rodolfo García Peñas (kix)
af18230a2a Reformat offlineimap/folder/Gmail.py
Add some spaces, remove lines,... now format is better (lintian).
2020-08-29 19:41:19 +02:00
Rodolfo García Peñas (kix)
9ebdbe47ee Reformat offlineimap/folder/Base.py
Add some spaces, remove lines,... now format is better (lintian).
2020-08-29 19:39:31 +02:00
Rodolfo García Peñas (kix)
18d2e972ac Mail now is typle of bytes convert to str
This patch saves the tuple and discard the bytes/str (now bytes).

Then, convert the tuple elements to str (from bytes).
2020-08-29 19:00:28 +02:00
Rodolfo García Peñas (kix)
7ba9ca1cca Maildir set is a builtin in python3
set() is a builtin, it is already included.
2020-08-29 09:22:23 +02:00
Rodolfo García Peñas (kix)
e61e77cf40 Convert bytes to string in IMAP folder
Convert the IMAP reply to string.
2020-08-28 17:25:06 +02:00
Rodolfo García Peñas (kix)
1379c32c5a IMAP do not use single quotes on fetch
The IMAP command is:

C: A654 FETCH 2:4 (FLAGS BODY[HEADER.FIELDS (DATE FROM)])

not

C: A654 FETCH '2:4' (FLAGS BODY[HEADER.FIELDS (DATE FROM)])

The single quotes must be removed.
2020-08-28 17:18:29 +02:00
Rodolfo García Peñas (kix)
bb5b1f2dcf Encode folder name before md5
Avoid the error:

Unicode-objects must be encoded before hashing
2020-08-28 16:51:11 +02:00
Rodolfo García Peñas (kix)
6ec6111896 2to3 main 2020-08-28 03:32:43 +02:00
Nicolas Sebrecht
fc61c6fd30 Gmail: allow parenthesis in labels
Reported-by Heinrich Hartmann <Heinrich@HeinrichHartmann.com>
Tested-by Heinrich Hartmann <Heinrich@HeinrichHartmann.com>
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/545
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2018-05-18 02:10:56 +02:00
Eygene Ryabinkin
3a807d0f2b Create filenames with no path separators in them
We use current hostname as the element of the unique file name.
Sometimes there is non-/24 zone delegation,
{{{
$ host 144.206.233.65
65.233.206.144.in-addr.arpa is an alias for 65.26/64.233.206.144.in-addr.arpa.
}}}
as per RFC 2317,
  https://www.rfc-editor.org/rfc/rfc2317.txt

So on Un*x systems we may run into having path separator inside
the file name.  Not good, things will choke.  Prevented this
by substituting all appeared path separators in the return value.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Tested-at: my MacOSX instance, my FreeBSD instances
2018-04-09 20:09:56 +03:00
Nicolas Sebrecht
e802f5fbd5 folder: IMAP: improve search logging
Log when exception occured during search command, too.

Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/512
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2017-12-22 15:13:51 +01:00
John Ferlito
3c6b07b25f Add missing space to output string
It was previously printing "Upgrading LocalStatus cache from version 1to version 2 for XXX"

Signed-off-by: John Ferlito <johnf@inodes.org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2017-11-26 18:05:10 +01:00
Nicolas Sebrecht
9805d3e7af no UIDPLUS: improve logging on failures
When there is not UIDPLUS we have to figure the UID by our means. When this
process fails, we don't know if the email was successfully uploaded. This patch
provides better logs to explain what happened.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2017-11-12 22:40:06 +01:00
Nicolas Sebrecht
5836970d51 utf8foldernames: fix missing decode argument
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/502
Tested-by: https://github.com/pprw
Reviewed-by: Ilias Tsitsimpis <i.tsitsimpis@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2017-10-29 00:45:32 +02:00
Urs Liska
ef3299b7ce Remove some unnecessary whitespace (in existing code)
Addresses https://github.com/OfflineIMAP/offlineimap/pull/498#discussion_r141672756

Signed-off-by: Urs Liska <git@ursliska.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2017-10-02 21:09:43 +02:00
Urs Liska
36d726763d utf8: implement utf8foldernames option
If utf8foldernames is enabled on account level all folder names read
from the IMAP server will immediately be reencoded to UTF-8. Names
will be treated as UTF-8 as long as the IMAP server isn't contacted again,
for which they are reencoded to IMAP4-UTF-7.

This means that any further processing such as nametrans, folderfilter
etc. will act upon the UTF-8 names, which will have to be documented
carefully.

NOTE 1:
GMail repositories and folders inherit from the IMAP... classes, so I don't
know yet if these changes have ugly side-effects. But web research suggests
that GMail IMAP folders are equally encoded in UTF-7 so that should work
identically here and incorporate the same improvements.

NOTE 2:
I could not test the behaviour with idlefolders as I didn't get this option
to work at all, not even with the latest stable version.

NOTE 3:
I *did* test to sync an IMAP repository against another IMAP repository.

Signed-off-by: Urs Liska <git@ursliska.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2017-10-02 21:09:43 +02:00
Urs Liska
dca5f1846d utf8 (aside): Move code for decodefoldernames
While intending *not* to change the behaviour of the existing
decodefoldernames option this commit transparently improves
the coding.
So far this worked by overriding the folder's getvisiblename() method
which reads self.visiblename from and applies the conversion on
*every* invocation of getvisiblename().
This commit does the calculation once in the IMAPFolder's __init__.

Signed-off-by: Urs Liska <git@ursliska.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2017-10-02 21:09:43 +02:00
Nicolas Sebrecht
19442d0010 folder: Gmail: fix copyright header
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2017-08-15 01:24:23 +02:00