SYNOPSIS

 tie my(%inbox), 'Mail::Box::Tie::HASH', $folder;

 foreach my $msgid (keys %inbox)
 {   print $inbox{$msgid};
     delete $inbox{$msgid};
 }

 $inbox{$msg->messageId} = $msg;

DESCRIPTION

Certainly when you look at a folder as being a set of related messages based on message-id, it is logical to access the folder through a hash.

For a tied hash, the message-id is used as the key. The message-id is usually unique, but when two or more instances of the same message are in the same folder, one will be flagged for deletion and the other will be returned.

This implementation uses basic folder access routines which are related to the message-id.