mjs / imapclient Goto Github PK
View Code? Open in Web Editor NEWAn easy-to-use, Pythonic and complete IMAP client library
Home Page: https://imapclient.readthedocs.io/
License: Other
An easy-to-use, Pythonic and complete IMAP client library
Home Page: https://imapclient.readthedocs.io/
License: Other
Originally reported by: Menno Smits (Bitbucket: mjs0)
In [1]: c.create_folder('"foo"')
Out[1]: 'Create completed.'
In [2]: c.create_folder('"foo" bar')
Out[2]: 'Create completed.'
In [3]: [x for x in c.list_folders() if 'foo' in str(x)]
Out[3]: [(['\\HasNoChildren'], '/', '"foo" bar'), (['\\HasNoChildren'], '/', 'foo')]
There could be similar issues with other folder handling methods.
Originally reported by: Menno Smits (Bitbucket: mjs0)
There have been several requests to able to register with the Trac instance via the website.
Originally reported by: Anonymous
If you connect to gmail's IMAP service and do
messages = client.fetch(uids, ["RFC822 FLAGS"])
you get back stuff that looks like
('28942 (UID 37383 RFC822 {1701}', '...'), ' FLAGS (\\Seen))'
Which causes fetch to barf.
I have a patch for a test and a fix, I don't see a way to attach a patch to this ticket...
Originally reported by: Menno Smits (Bitbucket: mjs0)
To reproduce:
c.create_folder("123")
c.list_folders()
TypeError!: 'int' object is not iterable
Originally reported by: Menno Smits (Bitbucket: mjs0)
'Test "folder"' is returned by list_folders() as 'Test '
Escaping needs to be handled correctly.
Originally reported by: Anonymous
>>> server.select_folder('william')
7L
>>> server.fetch(1, ("ENVELOPE",))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "imapclient/imapclient.py", line 436, in fetch
return parser(data)
File "imapclient/imapclient.py", line 573, in parse
msgid, data = self.parse_data(response_item)
File "imapclient/imapclient.py", line 614, in parse_data
for name, item in FetchTokeniser().process_pairs(data):
File "imapclient/imapclient.py", line 699, in process_pairs
for m in strict_finditer(self.PAIR_RE, s):
File "imapclient/imapclient.py", line 763, in strict_finditer
"%r before -- %r remains" % (s[:i], s[i:]))
ValueError: failed to match all of input. 'UID 1 ENVELOPE ("Fri, 16 Jul 2004 15:59:43 -0400" "on my way" (("Mark Eichin" NIL "eichin" "gmail.com")' before -- ') (("Mark Eichin" NIL "eichin" "gmail.com")) (("Mark Eichin" NIL "eichin" "gmail.com")) (("Other Person" NIL "..." "...")) NIL NIL NIL "<[email protected]>")' remains
(email address parts elided from one of the strings, but the match has already failed at that point. Also, this is with strict_finditer tweaked as-shown so you can see the successful part of the match as well as the failed part...)
It appears that this is what keeps fetch(1, ("ALL",)) from working, as well, it hits the !ValueError in the same place at least, and the other parts of ALL work when fetched individually.
Originally reported by: Menno Smits (Bitbucket: mjs0)
Originally reported by: Menno Smits (Bitbucket: mjs0)
This is probably a bad idea. "hg clone" followed by "python setup.py develop" is good enough.
Originally reported by: Menno Smits (Bitbucket: mjs0)
This will cause API breakage. Preserve the old method names and issue warnings?
Originally reported by: Shuhei Takahashi (Bitbucket: nya)
On FETCH, some servers repeat UID for multiple lines on its response. Current version of IMAPClient does not handle this correctly and some part of the response can be overwritten.
I'm attaching a small patch to resolve this issue.
Originally reported by: Menno Smits (Bitbucket: mjs0)
Ensure that tests are kept up to date with API changes
Originally reported by: Menno Smits (Bitbucket: mjs0)
The shipped example hasn't been kept up to date wrt to recent API changes.
Originally reported by: Menno Smits (Bitbucket: mjs0)
To support XLIST IMAPClient makes a globally visible runtime patch to imaplib. This could in theory affect other code that is using imaplib directly.
Investigate whether it is possible to avoid this patch by perhaps implementing xlist support at a lower level.
Originally reported by: Menno Smits (Bitbucket: mjs0)
The response parsing code has a number of hacks to work around the shlex based lexer (see !LiteralHandlingReader). It might be cleaner to use a lexer that is written specifically for this job.
Originally reported by: Menno Smits (Bitbucket: mjs0)
Details from Mark:
In short, there is a bug in imaplib when dealing with ssl connections
which terminate early - the SSL readline() method in imaplib gets into
a loop reading empty strings from the socket and appending them to a
list, chewing lots of memory and causing some consternation :)
The bug seems to be http://bugs.python.org/issue5949 and it has been
fixed in various versions, although I hit it in 2.6.3.
It was fixed in 2.6 in:
http://svn.python.org/view/python/branches/release26-maint/Lib/imaplib.py?r1=76761&r2=76760&pathrev=76761
But note that it has not been back-ported to 2.5 or earlier.
The bug report above includes a patch to imaplib's readline. It should
be possible to monkeypatch in the fixed version if a buggy imaplib
version is detected.
Originally reported by: Mark Hammond (Bitbucket: mhammond)
Do this as a keyword arg to list_folders?
Originally reported by: Menno Smits (Bitbucket: mjs0)
ENVELOPE fetch response items are curently just a nested set of tuples. A richer data structure would be friendlier to use. ENVELOPE responses should have helper properties/methods for getting the addresses out (and more?) and named attributes for each field.
Originally reported by: Menno Smits (Bitbucket: mjs0)
Fixed in encoding-bug branch but I'm not sure this is the correct way to solve the problem. Revisit.
Originally reported by: Anonymous
I get this error when posting a ticket (which is why 29 and 30 are duplicates, sorry) - the posting works, but I can't see the resulting ticket...
Trac Error
Genshi UnicodeDecodeError error while rendering template (unknown template location)
TracGuide โ The Trac User and Administration Guide
Originally reported by: Mark Hammond (Bitbucket: mhammond)
Add a xlist_folders method which returns a dict mapping folder types to folder names.
https://bugzilla.mozilla.org/show_bug.cgi?id=476260
http://www.ietf.org/mail-archive/web/morg/current/msg00208.html
Originally reported by: Menno Smits (Bitbucket: mjs0)
Originally reported by: Menno Smits (Bitbucket: mjs0)
Ensure that read-only folders and selects are handled correctly.
Originally reported by: anonymous (Bitbucket: anonymous)
>>> server.select_folder('william')
7L
>>> server.fetch(1, ("ENVELOPE",))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "imapclient/imapclient.py", line 436, in fetch
return parser(data)
File "imapclient/imapclient.py", line 573, in parse
msgid, data = self.parse_data(response_item)
File "imapclient/imapclient.py", line 614, in parse_data
for name, item in FetchTokeniser().process_pairs(data):
File "imapclient/imapclient.py", line 699, in process_pairs
for m in strict_finditer(self.PAIR_RE, s):
File "imapclient/imapclient.py", line 763, in strict_finditer
"%r before -- %r remains" % (s[:i], s[i:]))
ValueError: failed to match all of input. 'UID 1 ENVELOPE ("Fri, 16 Jul 2004 15:59:43 -0400" "on my way" (("Mark Eichin" NIL "eichin" "gmail.com")' before -- ') (("Mark Eichin" NIL "eichin" "gmail.com")) (("Mark Eichin" NIL "eichin" "gmail.com")) (("Other Person" NIL "..." "...")) NIL NIL NIL "<[email protected]>")' remains
(email address parts elided from one of the strings, but the match has already failed at that point. Also, this is with strict_finditer tweaked as-shown so you can see the successful part of the match as well as the failed part...)
It appears that this is what keeps fetch(1, ("ALL",)) from working, as well, it hits the ValueError in the same place at least, and the other parts of ALL work when fetched individually.
Originally reported by: Menno Smits (Bitbucket: mjs0)
http://tools.ietf.org/html/rfc4315
Originally reported by: Menno Smits (Bitbucket: mjs0)
Check what breaks.
What can be done to take advantage of Python 3?
Originally reported by: Menno Smits (Bitbucket: mjs0)
some servers have limits on the number of messages ids
Originally reported by: Menno Smits (Bitbucket: mjs0)
It should be possible to fetch or append large messages without having to load them into memory all at once.
Use file-like or generator style interface (generators is probably better).
This might mean ditching imaplib all together.
Originally reported by: Menno Smits (Bitbucket: mjs0)
Currently methods that return lists of folder name objects return (flags, delim, name) triples. It would be friendlier if these where namedtuples with "flags", "delimiter" and "name" attributes.
This avoids breaking the existing positional API while adding convenience (and avoiding magic numbers).
Example:
folders = client.list_folders()
folder = folders[0]
assert folder.flags == folder[0]
assert folder.delim == folder[1]
assert folder.name == folder[2]
Originally reported by: Menno Smits (Bitbucket: mjs0)
There were several tests tickets created and one with random chars.
These need to be removed directly from the DB (there's no UI for this).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.