Skip to content Skip to sidebar Skip to footer

Imaplib With Gmail Offsets Uids

I'm querying my gmail inbox using pythons ImapLib with a range parameter, but my returned uids are offset from what I request. My request is as follows: M = imaplib.IMAP4_SSL('imap

Solution 1:

It seems like M.uid simply specifies that the return value will be UID's, so it is still necessary to specify that the parameters sent will be UID's and not message ID's. This fixes it:

rv, data = M.uid("search", None, 'UID', '29540:*')

Solution 2:

rv, data = M.uid("search", None, '(UID 29540:*)')


Post a Comment for "Imaplib With Gmail Offsets Uids"