When I'm searching an email account using imaplib I need to be able to search with variables to cycle through a large number of automated mail, but I'm getting different results between when I explicitly pass a string and when I pass a variable with that same string. Example:
>>> rv,data = M.search(None, 'SUBJECT','"Sucessful Migrations 2019-07-08"')
>>> data
[b'28']
>>> item = '"Successful Migrations 2019-07-08"'
>>> rv,data = M.search(None, 'SUBJECT',item)
>>> data
[b'']
How can I correctly pass my search criteria in a variable to get the desired result?