This queue is for tickets about the Net-IMAP-Simple CPAN distribution.

Report information
The Basics
Id:
122163
Status:
open
Priority:
Low/Low

People
Owner:
jettero [...] cpan.org
Requestors:
thomas.delepinne [...] ecampus-hainaut.be
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



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

Oh, I forgot about this issue. Thanks for opening a ticket.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.