So I'm downloading the mail from a pop3 box using:
use Net::POP3;
my $pop = Net::POP3->new('www.myhost.com', Timeout => 90);
if ($pop->login('listaddress+myhost.com','pass') > 0) {
my $msgnums = $pop->list;
foreach my $msgnum (keys %$msgnums) {
my $msg = $pop->get($msgnum);
}
}
$pop->quit;
Pretty much straight from the POP3 docs.
Now I want to use Mail::Box::MH to save the retrieved messages to an MH style folder.
So I add:
use Mail::Box::MH;
my $folder = new Mail::Box::MH folder => '/mypath/myspecialmailboxfold
+er';
at the top, and then in the loop I put:
my $MHmsg = join "",@$msg;
$folder->addMessage($MHmsg);
which fails because addMessage must recieve a message object.
So I search diligently for a (prefab) way to construct a message object from the plaintext that is returned from the POP3 get call because I know that I'm not competent enough to handle parsing all the possible (standard and non-standard) MIME and non-MIME headers and bodies for myself. I have had no luck. Can anyone point me in the right direction?