IMAP4.search by message-id ?

Sean Dodsworth sdodswor at tpg.com.au
Thu Mar 31 15:56:08 EST 2005


Tony Meyer wrote:

>> Can anyone tell me how to get a message's number from the message-id
>> using IMAP4.search?
>> I've tried this:
>>     resp, items = server.search(None, 'HEADER',
>> '"Message-id"', msgID) but it gives me a 'bogus search criteria' error
> 
>>>> import imaplib
>>>> i = imaplib.IMAP4("mail.example.com")
>>>> i.login("username", "password")
> [...]
>>>> i.select()
> [...]
>>>> i.search(None, '(HEADER Message-ID
> "<20040929030919.78882.qmail at web20025.mail.yahoo.com>")')
> ('OK', ['4'])
>>>> i.logout()
> [...]
> 
> =Tony.Meyer

Thank Tony...works fine now



More information about the Python-list mailing list