Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

select function from Mail::IMAPClient

by funkymonky (Initiate)
on Sep 05, 2002 at 08:49 UTC ( [id://195317]=perlquestion: print w/replies, xml ) Need Help??

funkymonky has asked for the wisdom of the Perl Monks concerning the following question: (mail and news)

the following method selects a folder $imap->select($folder) When I trace the response from the server, it looks like this:
000E SELECT "INBOX" * FLAGS (\Answered \Flagged \Draft \Deleted \Seen) * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)] * 3 EXISTS * 0 RECENT * OK [UIDVALIDITY 1030359672] * OK [UIDNEXT 191] 000E OK [READ-WRITE] Completed
Now I want to use this in my program. The function returns a hash reference so I do the following:
%map_status=%{$imap->select("INBOX")};

This command works perfectly, but the PROBLEM is it does not contain the server response.
QUESTION: How do I extract the server response?

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: select function from Mail::IMAPClient
by jlongino (Parson) on Oct 19, 2002 at 17:11 UTC
    You probably want to use the Results method (without argument) to obtain the server response from the last IMAP client command issued:
    use strict; use warnings; use Mail::IMAPClient; use Data::Dumper; my $host = 'some.server.net'; my $id = 'login'; my $pw = 'password'; my $folder = "/somepath/tomail/folder"; my $imap = Mail::IMAPClient->new( Server => $host, User => $id, Password => $pw, Debug => 1, ) or die "Cannot connect to $host as $id: $@"; $imap->select($folder); my @results1 = $imap->Results; my @status = $imap->status($folder); my @results2 = $imap->Results; my $uidnext = $imap->uidnext($folder); my @results3 = $imap->Results; print Dumper(\@results1, \@status, \@results2, $uidnext, \@results3);

    --Jim

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://195317]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found