From: | "raphael langella" <raphael.langella [...] steria.com> |
To: | <bug-Mail-IMAPClient [...] rt.cpan.org> |
Subject: | cannot get bodystructure nor envelope |
Date: | Tue, 24 Dec 2002 12:19:33 +0100 |
Hi,
I'm using IMAPClient 2.2.5 with perl 5.8.0 build 804 under Windows NT 4.0
SP6.0a (french version). I'm running a simple script that connects to an
Exchange 5.5 server, does a search and tries to get envelope of messages.
Here's the script :
use Mail::IMAPClient;
use Mail::IMAPClient::BodyStructure;
my $days_to_keep = 2; # Delete msgs older than 2 days
my $cutoff = time - ( $days_to_keep * 24 * 60 * 60 ) ; # time - arg * 24 *
60 * 60 = cutoff date in seconds
my $imap = Mail::IMAPClient->new(
Server => 'X',
User => 'X',
Password=> 'X',
Debug=> 1,
) or die "Cannot connect: $@";
$imap->{Fast_io} = 0;
$imap->Peek(1);
$imap->select('Inbox') or die "cannot select inbox $@\n";
my @msgs = $imap->search("SENTBEFORE",$imap->Rfc2060_date($cutoff));
foreach (@msgs) {
my $envObject = $imap->get_envelope($_) or die "Could not get_envelope:
$@\n";
}
and here is the output :
Using Mail::IMAPClient version 2.2.5 and perl version 5.8.0 (5.008)
Mail::IMAPClient not using Fast_IO; not available on this platform at
surv.pl line 24
Read: * OK La version 5.5.2653.23 (X) du serveur IMAP4rev1 Microsoft
Exchange est prête
Connect: Received this from readline: 0/OUTPUT/* OK La version 5.5.2653.23
(X) du serveur IMAP4rev1 Microsoft Exchange est prête
Sending: 1 Login "XXXXXXX" XXXXXXX
Sent 31 bytes
Read: 1 OK LOGIN terminée.
Sending: 2 SELECT "Inbox"
Sent 39 bytes
Read: * 30 EXISTS
Read: * 0 RECENT
Read: * FLAGS (\Seen \Answered \Flagged \Deleted \Draft)
Read: * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft)]
Read: * OK [UNSEEN 1] Premier message non vu
Read: * OK [UIDVALIDITY 404] Valeur UIDVALIDITY.
Read: 2 OK [READ-WRITE] SELECT terminée.
Sending: 3 UID SEARCH SENTBEFORE 22-Dec-2002
Sent 37 bytes
Read: * SEARCH 529262 529263
Read: 3 OK SEARCH terminée.
Sending: 4 UID FETCH 529262 ENVELOPE
Sent 29 bytes
LITERAL: received literal in line * 1 FETCH (ENVELOPE ("Fri, 20 Dec 2002
18:09:22 +0100" of length 61; attempting to retrieve from the 0 bytes in:
<END_OF_iBuffer>
Read: * 1 FETCH (ENVELOPE ("Fri, 20 Dec 2002 18:09:22 +0100" Subject.
(("sender full name" NIL "login" "domain")) (("sender full name" NIL "login"
"domain")) (("sender full name" NIL "login" "domain")) (("reicever full
name" NIL "reicever login" "domain")) NIL NIL NIL
"<A29A5EEDBB0AD711A54600065B8E84CC0C4362@SLS-MSG>") UID 529262)
Read: 4 OK FETCH terminée.
get_envelope: msg 529262 returns this ref: UNDEF
Could not get_envelope:
I also cannot get any bodystructre, I always get an undef value.
Raphaël Langella