Subject: | Change in "get" method behaviour between 1.2206 and later versions |
Date: | Wed, 21 Jun 2017 07:13:09 +0000 |
To: | "bug-Net-IMAP-Simple [...] rt.cpan.org" <bug-Net-IMAP-Simple [...] rt.cpan.org> |
From: | Thomas DELEPINNE <thomas.delepinne [...] ecampus-hainaut.be> |
After upgrading from Net::IMAP::Simple 1.2206 to 1.2207, I noticed a change in behaviour of the "get" method.
Looking at both version of "Simple.pm" confirmed that some refactoring occurred.
In version 1.2206, using "my $msg = $imap->get( $msgid, '1' );" would get an email's body.
For version 1.2207 and later, using the same code wield an empty string.
To test this, I used the following code:
#!/usr/bin/perl
use strict;
use utf8;
use warnings;
use Net::IMAP::Simple::SSL;
# Maibox config
my $imaphost = 'imap.gmail.com';
my $imapusr = 'emailaccount';
my $imappass = 'password';
my $imap = Net::IMAP::Simple::SSL->new($imaphost) or die "Unable to connect to IMAP";
$imap->login($imapusr, $imappass) or die "Unable to log-in";
my @msgids = $imap->search("UNSEEN");
for my $msgid (@msgids) {
my $msg = $imap->get($msgid,'1');
print "$msg\n";
}
I use perl v5.24.1 on a Debian 4.9.30-2+deb9u1