title: I cannot search sent emails in Gmail with Python
body: <p>I am trying to search for messages in the Sent (actually i care for both) but I only get incoming messages.
  For the time being i have</p>
  
  <pre><code>imap_conn.select()
  str_after = after.strftime('%d-%b-%Y')
  typ, msg_ids = imap_conn.search('UTF-8','SINCE',str_after)
  </code></pre>
  
  <p>Which gives equivalent results with this</p>
  
  <pre><code>imap_conn.select('INBOX')
  </code></pre>
  
  <p>When I replace INBOX with ALL or SENT I get:
  command SEARCH illegal in state AUTH, only allowed in states SELECTED</p>