IMAP search for email address in the from field
问题 I am trying to search and filter my imap mails using python's imaplib. I am running into a quite strange problem with the search command, searching for email addresses in the FROM field. I have the following script, print('search with name') status, results = con.search(None, '(FROM "Shrikant Sharat")') if status == 'OK': if results[0]: mid = results[0].split()[0] print('mail id', mid) print(con.fetch(mid, '(UID BODY[HEADER.FIELDS (FROM)])')) else: print('No results yielded') else: print(