geoffeg has asked for the wisdom of the Perl Monks concerning the following question:

Hello. I'm trying to use Mail::Box::IMAP4 and I need to list all the available files in a directory (/home/username/mail/). I can't find a method that will do this in M::B::IMAP4. I'm trying to write a dumb little mail client that can access mail through IMAP but I need it to show me the list of all the files in the directory so I can choose which one to process as a mail spool/folder. Thanks, Geoffeg

Replies are listed 'Best First'.
Re: Mail::Box::IMAP4
by idsfa (Vicar) on Apr 23, 2004 at 20:42 UTC

    The docs suggest:

    my $folder = $mgr->open('=in/new'); my @subs = $folder->listSubFolders; my @subs = Mail::Box::IMAP4->listSubFolders(folder => '=in/new'); my @subs = Mail::Box::IMAP4->listSubFolders; # toplevel folders.

    But if you are using local folders, don't you want Mail::Box::Mbox? (NB, the docs indicate that mbox files "For MBOX folders, sub-folders are simulated."


    If anyone needs me I'll be in the Angry Dome.