On Tue May 18 11:10:44 2010, gbarr@pobox.com wrote:
Show quoted text> Can you provide a small script and debug transcript that shows the
issue?
Show quoted text>
#connect to pop3
my $pop = Net::POP3->new("$pop3host", Timeout => 60);
if ($pop->login($pop3usr, $pop3pass) > 0) {
my $msgnums = $pop->list; # hashref of msgnum => size
foreach my $msgnum (keys %$msgnums) {
my $msg = $pop->get($msgnum);
my $p = MsgParse->new();
my $md = $p->read_full($msg);
my $bzbody;
if ($zoption eq 'yes') {
$bzbody = compress( $md->{body}, ['9'] );
}
else {
$bzbody = $md->{body};
}
my $sth = $dbh->prepare("INSERT INTO
msg_data(`epoch`,`from`,`to`,`subject`,`body`,`header`)
VALUES(?,?,?,?,?,?)");
$sth->execute($md->{date},$md->{from},$md->{to},$md-
Show quoted text>{subject},$bzbody,$md->{header});
$pop->delete($msgnum);
}
}
$pop->quit;
MsgParse is using Mail::Message to parse the message. If POP3 box is
relatively small - 50-100 messages, the script runes fine. All the
messages are deleted at the end. But with 3000 and 16000 messages it
breaks and no emails are deleted.
I use it to fetch catchall@ email box and store all messages in mysql
table for archive purpose