My bets are, you're just not forming the From line...
No problem... this works great (with mutt anyway):
#!/usr/bin/perl
use strict;
use POSIX;
use Net::POP3;
my $pop = new Net::POP3 "pop3.domain.dom";
my $num = $pop->login("jobe", "password");
if( $num ) {
print "There were $num messages.\n";
open OUT, ">snagged.mail" or die "crap ($!)";
for my $i (1..$num) {
print "getting message #$i\n";
my $msg = $pop->get($i);
$msg->[0] =~ m/<(.+?)>/;
print OUT &strftime("From $1 " . q(%a %b %d %H:%M:%S %Y), loca
+ltime), "\n";
print OUT $_ for @$msg;
print OUT "\n";
}
close OUT;
} else {
print "bad login\n";
}
|