Reputation: 355
Trying to figure out how this syntax works:
result, data = mail.uid('search', searchLine, "ALL")
My first succesfull aproach was using the syntax for sorting the inbox , by:
result, data = mail.uid('search', None, "ALL")
While my actual target is to sort the inbox separately one by one. For this i used the first syntax described above, ofcourse without any success.
Some assist in explaining how this syntax works, would be appreciated.
Upvotes: 1
Views: 46
Reputation: 781716
You're not providing the search string properly. See the IMAP specification for the syntax of the SEARCH
command. It has to be followed by keywords that specify the searching criteria, and some of these keywords have parameters.
You have to specify where in the message you're searching for the search term.
result, data = mail.uid('search', 'TEXT', searchLine)
The TEXT
keyword specifies that it should search in the message header and body for the value of searchLine
.
Upvotes: 2