From: Paul Brannan Date: 2005-04-27T00:32:31+09:00 Subject: Re: net/imap retrieve list of folders On Tue, Apr 26, 2005 at 03:44:02PM +0900, Robby Russell wrote: > I am playing with Net::IMAP and trying to figure out how to retrieve the > list of subscribed folders. In all the examples that I have come across, > none of them show this. I can find messages in a specific folder, but > for my app I will need to build a list of folders that the user is > subscribed to. > > How/can this be done? Use Net::IMAP#lsub: irb(main):016:0> imap.subscribe('mail/ruby') => #, raw_data="RUBY0011 OK SUBSCRIBE completed\r\n"> irb(main):017:0> imap.subscribe('mail/ruby-core') => #, raw_data="RUBY0012 OK SUBSCRIBE completed\r\n"> irb(main):018:0> imap.subscribe('mail/rubygems') => #, raw_data="RUBY0013 OK SUBSCRIBE completed\r\n"> irb(main):019:0> imap.lsub('mail', '*') => [#, #, #] You can find the documentation for #list and #lsub in imap.rb. Paul