index file is overwritten

Simon von Janowsky <[email protected]> Wed, 09 Feb 2005 18:58:48 +0100
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <[email protected]>
Hello,
when using a MH Mail-Folder I try to use the index file to have a faster 
access to the Mailheaders.
It all works fine when I call the script for the first time, the message 
is moved to the MH Folder
and the .index file is created.

When I call the script for the second time the next message from the 
pop3 server is appended correctly,
but the .index file is overwritten with the Header of the second mail. 
The second header isn't appended to the index file.

Is that the correct behaviour? Or am I doing something terribly wrong? 
Have I missed something in the documentation?

thanks for any help,
Simon.

--------------------------------------------------------------------------------------------------
#!/usr/bin/perl
use Mail::Box;
use Mail::Box::Manager;

use strict;
use warnings;
use diagnostics;

my $mgr = Mail::Box::Manager->new();
my $pop = $mgr->open(
                      access      => 'rw',
                      type        => 'pop3',
                      username    => 'xxxxxxxx',
                      password    => 'xxxxxxxx',
                      server_name => 'xxxxxxxx'
);
my $mh = $mgr->open(
                     folder     => 'INBOX',
                     type       => 'Mail::Box::MH',
                     create     => '1',
                     access     => 'rw',
                     keep_index => '1'
);
$mgr->moveMessage( $mh, $pop->message(1) );
$mgr->closeAllFolders();
--------------------------------------------------------------------------------------------------