Reputation: 97
I have trouble using impalib to search email that contain more than two subjects, for example:
import imaplib
m = imaplib.IMAP4_SSL("imap.gmail.com")
m.login('myname', 'mypwd')
m.select("Inbox")
resp, items = m.uid('search', None, "(SUBJECT baseball SUBJECT basketball)")
will have no problem getting data from searching those subject. However, if i search more than two subjects
resp, items = m.uid('search', None, "(SUBJECT baseball SUBJECT basketball SUBJECT football)")
it won't have data come back. also, subject like ""space jam" or "matchbox 20" will have trouble of parsing in the field
Upvotes: 2
Views: 3590
Reputation: 31
you can search like this.
m.uid('search', None, "(OR (SUBJECT baseball) (SUBJECT basketball))")
Upvotes: 3