This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abhishek
Recipients abhishek, piers, pierslauder
Date 2009-02-03.19:57:33
SpamBayes Score 9.674048e-06
Marked as misclassified No
Message-id <1233691056.73.0.419384658246.issue5146@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2009-02-03 19:57:37abhisheksetrecipients: + abhishek, pierslauder, piers
2009-02-03 19:57:36abhisheksetmessageid: <1233691056.73.0.419384658246.issue5146@psf.upfronthosting.co.za>
2009-02-03 19:57:35abhisheklinkissue5146 messages
2009-02-03 19:57:33abhishekcreate