title: Select mailbox "sent mail" or "all mail" in Ruby Net::IMAP
body: <p>I'm trying to use Net::IMAP in Ruby to search all mail sent by me, but I'm having trouble selecting anything other than INBOX.</p>
  
  <pre><code>imap.select('INBOX')
  </code></pre>
  
  <p>works fine, but</p>
  
  <pre><code>imap.select('Mail/sent-mail')
  </code></pre>
  
  <p>as shown on the Net::IMAP documentation gives me "Unknown Mailbox".</p>
  
  <p>Incidentally, this is to be used with gmail.</p>
  
  <p>I also tried adding "in", "anywhere" to my imap.search(), but that didn't parse. </p>
  
  <p>Current code:</p>
  
  <pre><code>imap.select('INBOX')
  now = Time.now.localtime - 1209600 #two weeks
  since = now.day.to_s() + "-" + Date::MONTHNAMES[now.month] + "-" + now.year.to_s()
  puts "since"
  puts since
  begin
    mail_ids = imap.search(["FROM", "me", "SINCE", since])
    mail_ids.each do |id|
      text = imap.fetch(id, 'BODY[HEADER.FIELDS (SUBJECT)]').to_s.split("{").second.chop
      puts text
    end
  end
  </code></pre>