Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: IMAP4.search by message-id ?

Reply
Thread Tools

RE: IMAP4.search by message-id ?

 
 
Tony Meyer
Guest
Posts: n/a
 
      03-31-2005
> 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

"<(E-Mail Removed) om>")')
('OK', ['4'])
>>> i.logout()

[...]

=Tony.Meyer

 
Reply With Quote
 
 
 
 
Sean Dodsworth
Guest
Posts: n/a
 
      03-31-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

> "<(E-Mail Removed) om>")')
> ('OK', ['4'])
>>>> i.logout()

> [...]
>
> =Tony.Meyer


Thank Tony...works fine now
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments