modified to handle more than one mailbox at at time, allowing duplicate messages to be removed across mailboxes