By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,675 Members | 2,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,675 IT Pros & Developers. It's quick & easy.

IMAP4.search by message-id ?

P: n/a
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

Any ideas?
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sean Dodsworth 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

Why do you need the 'HEADER'

Wouldn't this be enough?

resp, items = server.search(None, 'Message-id', msgID)

I am note shure if the msgId should be quoted. I assume not, as it will
allways be an integer.

--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science
Jul 18 '05 #2

P: n/a
Max M wrote:
Sean Dodsworth 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

Why do you need the 'HEADER'

Wouldn't this be enough?

resp, items = server.search(None, 'Message-id', msgID)

I am note shure if the msgId should be quoted. I assume not, as it will
allways be an integer.


Max,
Thanks, but it didnt work.
I still get the same error:
error: SEARCH command error: BAD ['Bogus criteria list in SEARCH']
args = ("SEARCH command error: BAD ['Bogus criteria list in SEARCH']",)

I had originally included the HEADER field as per the RFC3501 documentation:
HEADER <field-name> <string>

also, the message-id is not an integer its a string like:
<1e******************************@agsdc.net>

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.