Message81094
Hi,
IMAP commands in general can be either called directly or via the UID
command which basically returns the UIDs instead of message IDs.
Consider this example:
02:23.02 > GDJB3 UID THREAD references UTF-8 (SEEN)
02:23.02 < * THREAD (3)(2)(4)(1)
02:23.02 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' =>
('THREAD', ' (3)(2)(4)(1)', '(3)(2)(4)(1)')
02:23.03 untagged_responses[THREAD] 0 += ["(3)(2)(4)(1)"]
02:23.03 < GDJB3 OK Thread completed.
02:23.03 matched r'(?P<tag>GDJB\d+) (?P<type>[A-Z]+) (?P<data>.*)'
=> ('GDJB3', 'OK', 'Thread completed.')
[None]
...
02:59.22 > CNCF3 THREAD references UTF-8 (SEEN)
02:59.23 < * THREAD (3)(2)(4)(1)
02:59.23 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' =>
('THREAD', ' (3)(2)(4)(1)', '(3)(2)(4)(1)')
02:59.23 untagged_responses[THREAD] 0 += ["(3)(2)(4)(1)"]
02:59.23 < CNCF3 OK Thread completed.
02:59.23 matched r'(?P<tag>CNCF\d+) (?P<type>[A-Z]+) (?P<data>.*)'
=> ('CNCF3', 'OK', 'Thread completed.')
02:59.23 untagged_responses[THREAD] => ['(3)(2)(4)(1)']
['(3)(2)(4)(1)']
The reason I figured out why UID failed whereas the direct method call
worked lies in this particular line of the method 'uid' in imaplib.py:
if command in ('SEARCH', 'SORT'):
name = command
else:
name = 'FETCH'
which should be :
if command in ('SEARCH', 'SORT', 'THREAD'):
name = command
else:
name = 'FETCH'
I was able to confirm this in both 2.4 and 2.5.
Hope this would be looked upon and fixed.
Regards,
Abhishek |
|
Date |
User |
Action |
Args |
2009-02-03 19:57:37 | abhishek | set | recipients:
+ abhishek, pierslauder, piers |
2009-02-03 19:57:36 | abhishek | set | messageid: <1233691056.73.0.419384658246.issue5146@psf.upfronthosting.co.za> |
2009-02-03 19:57:35 | abhishek | link | issue5146 messages |
2009-02-03 19:57:33 | abhishek | create | |
|