title: Python IMAP Search from or to designated email address
body: <p>I am using this with Gmail's SMTP server, and I would like to search via IMAP for emails   either sent to or received from an address.</p>
  
  <p>This is what I have:</p>
  
  <pre><code>mail = imaplib.IMAP4_SSL('imap.gmail.com')
  
  mail.login('user', 'pass')
  mail.list()
  mail.select("[Gmail]/All Mail")
  
  status, email_ids = mail.search(None, 'TO "tech163@fusionswift.com" OR FROM "tech163@fusionswift.com"')
  </code></pre>
  
  <p>The last line of the error is: <code>imaplib.error: SEARCH command error: BAD ['Could not parse command']</code></p>
  
  <p>Not sure how I'm supposed to do that kind of OR statement within python's <code>imaplib</code>. If someone can quickly explain what's wrong or point me in the right direction, it'd be greatly appreciated.</p>