in reply to Memory problem

You'll want to look at doing delayed loading of the message bodies when you do your folder opens. Based on the docs I believe it should be:

my $mbox_cm = $mbm->open( folder => $copymail, access => 'rw', body_delayed_type => 'Mail::Message::Body::D +elayed')

Hope this helps.

Frank Wiles <frank@wiles.org>
http://www.wiles.org