perlquestion
japhy
I don't know if this is a problem with gmail's POP3 service or the Net::POP3 (and Net::POP3::SSLWrapper) module, or some devilish combination of the two.
<br><br>
I have a gmail account, foo@gmail.com, that has POP3 enabled for all email, and the option for "delete gmail's copy of the email" is set.
<br><br>
And yet, when I run the code below, the message is not deleted. No error message is available (as far as I know). Has anyone had a similar problem with a home-grown gmail POP3 program?
<code>
use Net::POP3::SSLWrapper;
use strict;
use warnings;
pop3s {
my $pop = Net::POP3->new('pop.gmail.com', Port => 995) or die "can't make pop3 connection: $!";
my $nm = $pop->login('foo@gmail.com', 'password');
my $msgs = $pop->list;
while (my ($id, $data) = each %$msgs) {
print "Message ID: $id\n";
$pop->delete($id);
}
};
__END__
Here is actual output:
[root@XBASEBK1 popgrabber]# perl jxp.pl
Messages: 4
Message ID: 4
Message ID: 1
Message ID: 3
Message ID: 2
[root@XBASEBK1 popgrabber]# perl jxp.pl
Messages: 4
Message ID: 4
Message ID: 1
Message ID: 3
Message ID: 2
[root@XBASEBK1 popgrabber]# perl jxp.pl
Messages: 4
Message ID: 4
Message ID: 1
Message ID: 3
Message ID: 2
</code>
Any ideas?
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-1936">
<hr/>
Jeff <tt><font color="#0000ff">[japhy]</font></tt> Pinyan,
[id://371157|P.L., P.M., P.O.D, X.S.]:
<a href="http://japhy.perlmonk.org/modules/">Perl</a>,
<a href="http://japhy.perlmonk.org/modules/Regexp-Parser/">regex</a>,
and <a href="http://lists.perl.org/showlist.cgi?name=perl5-porters"><tt>perl</tt></a>
<a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=hacker">hacker</a>
<br>
<i>Nos autem praedicamus Christum crucifixum</i> (1 Cor. 1:23) - <b><a href="http://thecrossreference.blogspot.com/">The Cross Reference</a></b> (My Blog)
</div></div>